From cbaac9632459e36e951cb89e4d7d1a5d607ff2d1 Mon Sep 17 00:00:00 2001 From: zico Date: Thu, 10 Sep 2015 13:19:34 +0200 Subject: [PATCH] Fixed (hacked) homing missiles fired by bots that would not track players if player with lowest objnum is dead --- similar/main/laser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/similar/main/laser.cpp b/similar/main/laser.cpp index 7f663aea4..4d0562d93 100644 --- a/similar/main/laser.cpp +++ b/similar/main/laser.cpp @@ -1253,6 +1253,9 @@ static objptridx_t track_track_goal(const objptridx_t track_goal, const vobjptri return find_homing_object_complete(tracker->pos, tracker, OBJ_PLAYER, goal2_type); else { goal_type = Objects[tracker->ctype.laser_info.track_goal].type; + // HACK: Dead players can be identified as valid track_goal, making it impossible to track players that are alive (further down the object list) in a multibot match. Re-assigning OBJ_GHOST to OBJ_PLAYER so homers can check for valid targets again. I think this should be fixed at the root of the problem but I am not sure if this may break more than we aim to fix. + if ((Game_mode & GM_MULTI) && (goal_type == OBJ_GHOST)) + goal_type = OBJ_PLAYER; return find_homing_object_complete(tracker->pos, tracker, goal_type, goal2_type); } }