From 13af4386129365f35975f304970f28e2417cde8d Mon Sep 17 00:00:00 2001 From: doyle Date: Fri, 20 Oct 2023 21:06:56 +1100 Subject: [PATCH] fp: Make players unable to collide with each other --- feely_pona_game.cpp | 11 +++++++++++ feely_pona_game.h | 5 ----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/feely_pona_game.cpp b/feely_pona_game.cpp index 6b04a42..cca389e 100644 --- a/feely_pona_game.cpp +++ b/feely_pona_game.cpp @@ -942,6 +942,17 @@ static FP_GameCanMoveToPositionResult FP_Game_CanEntityMoveToPosition(FP_Game *g if ((collider->flags & FP_GameEntityFlag_NonTraversable) == 0) continue; + bool skip_colliding_with_player = false; + for (FP_GameEntityHandle player : game->play.players) { + if (player == collider->handle) { + skip_colliding_with_player = true; + break; + } + } + + if (skip_colliding_with_player) + continue; + bool entity_collides_with_collider = true; switch (entity->type) { case FP_EntityType_Catfish: /*FALLTHRU*/ diff --git a/feely_pona_game.h b/feely_pona_game.h index 415ae65..a031e34 100644 --- a/feely_pona_game.h +++ b/feely_pona_game.h @@ -356,11 +356,6 @@ struct FP_GamePlay FP_GameEntityHandle merchant_gym; FP_GameEntityHandle merchant_phone_company; - Dqn_V2 merchant_terry_menu_pos; - Dqn_V2 merchant_graveyard_menu_pos; - Dqn_V2 merchant_gym_menu_pos; - Dqn_V2 merchant_phone_company_menu_pos; - FP_GameEntityHandle clicked_entity; FP_GameEntityHandle hot_entity; FP_GameEntityHandle active_entity;