diff --git a/feely_pona.cpp b/feely_pona.cpp index d2e4168..fc15d1f 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -1511,27 +1511,13 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input } if (!has_waypoint_to_defender) { - FP_GameEntity *defender = FP_Game_GetEntity(game, closest_defender.entity); - FP_GameDirection aggro_direction = FP_GameDirection_Count; - DQN_FOR_UINDEX(dir_index, FP_GameDirection_Count) { - FP_GameEntityHandle slot_entity_handle = defender->aggro_slot[dir_index]; - FP_GameEntity *slot_entity = FP_Game_GetEntity(game, slot_entity_handle); - if (FP_Game_IsNilEntity(slot_entity)) { - aggro_direction = DQN_CAST(FP_GameDirection)dir_index; - break; - } - } - + FP_GameEntity *defender = FP_Game_GetEntity(game, closest_defender.entity); FP_SentinelListLink *link = FP_SentinelList_MakeBefore(&entity->waypoints, FP_SentinelList_Front(&entity->waypoints), game->play.chunk_pool); FP_GameWaypoint *waypoint = &link->data; waypoint->entity = defender->handle; - if (aggro_direction != FP_GameDirection_Count) { - waypoint->type = FP_GameWaypointType_Side; - waypoint->type_direction = aggro_direction; - defender->aggro_slot[aggro_direction] = entity->handle; - } + waypoint->type = FP_GameWaypointType_ClosestSide; } } else { if (closest_defender.dist_squared > DQN_SQUARED(aggro_dist_threshold * 2.f)) { @@ -1667,7 +1653,8 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input Dqn_f32 arrival_threshold = {}; switch (waypoint->arrive) { case FP_GameWaypointArrive_Default: { - arrival_threshold = FP_Game_MetersToPixelsNx1(game->play, 0.5f); + Dqn_Rect waypoint_hit_box = FP_Game_CalcEntityWorldHitBox(game, waypoint_entity->handle); + arrival_threshold = waypoint_hit_box.size.w * .5f; } break; case FP_GameWaypointArrive_WhenWithinEntitySize: { diff --git a/feely_pona_entity_create.cpp b/feely_pona_entity_create.cpp index 9f42b64..99279bb 100644 --- a/feely_pona_entity_create.cpp +++ b/feely_pona_entity_create.cpp @@ -197,8 +197,8 @@ FP_EntityRenderData FP_Entity_GetRenderData(FP_Game *game, FP_EntityType type, u switch (direction) { case FP_GameDirection_Up: result.anim_name = g_anim_names.catfish_attack_up; break; case FP_GameDirection_Down: result.anim_name = g_anim_names.catfish_attack_down; break; - case FP_GameDirection_Left: result.anim_name = g_anim_names.catfish_attack_side; result.flip = TELY_AssetFlip_X; break; - case FP_GameDirection_Right: result.anim_name = g_anim_names.catfish_attack_side; break; + case FP_GameDirection_Left: result.anim_name = g_anim_names.catfish_attack_side; break; + case FP_GameDirection_Right: result.anim_name = g_anim_names.catfish_attack_side; result.flip = TELY_AssetFlip_X; break; case FP_GameDirection_Count: DQN_INVALID_CODE_PATH; break; } } break; diff --git a/feely_pona_game.cpp b/feely_pona_game.cpp index e3478f5..673bd08 100644 --- a/feely_pona_game.cpp +++ b/feely_pona_game.cpp @@ -741,7 +741,9 @@ static Dqn_V2 FP_Game_CalcWaypointWorldPos(FP_Game *game, FP_GameEntityHandle sr } } - Dqn_f32 curr_dist_to_entity = Dqn_V2_LengthSq_V2x2(entity_rect.pos, src_rect.pos); + Dqn_V2 entity_pos = FP_Game_CalcEntityWorldPos(game, waypoint_entity->handle); + Dqn_V2 src_pos = FP_Game_CalcEntityWorldPos(game, src_entity); + Dqn_f32 curr_dist_to_entity = Dqn_V2_LengthSq_V2x2(entity_pos, src_pos); if (curr_dist_to_entity < best_dist) { // NOTE: We are already closer to the entity than the closest calculated side, // we assume we're at the entity already.