diff options
author | Michael Sterrett <mr_bones_@gentoo.org> | 2004-11-09 08:57:23 +0000 |
---|---|---|
committer | Michael Sterrett <mr_bones_@gentoo.org> | 2004-11-09 08:57:23 +0000 |
commit | c6d0c11faacc1fd0c1aa8354742957d7ec9ad78c (patch) | |
tree | 5ce81d82b485da5d920cdedfecd62a46e7da2d70 /games-action/orbital-eunuchs-sniper/files | |
parent | added libtool dep (diff) | |
download | historical-c6d0c11faacc1fd0c1aa8354742957d7ec9ad78c.tar.gz historical-c6d0c11faacc1fd0c1aa8354742957d7ec9ad78c.tar.bz2 historical-c6d0c11faacc1fd0c1aa8354742957d7ec9ad78c.zip |
Add patch from upstream bugzilla to fix crash. Reported by Florian Loitsch via bug #67812
Diffstat (limited to 'games-action/orbital-eunuchs-sniper/files')
-rw-r--r-- | games-action/orbital-eunuchs-sniper/files/1.29-ai.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/games-action/orbital-eunuchs-sniper/files/1.29-ai.patch b/games-action/orbital-eunuchs-sniper/files/1.29-ai.patch new file mode 100644 index 000000000000..b80260fc31a7 --- /dev/null +++ b/games-action/orbital-eunuchs-sniper/files/1.29-ai.patch @@ -0,0 +1,44 @@ +--- src/ai_orig.cpp 2003-03-17 17:22:17.000000000 +0100 ++++ src/ai.cpp 2004-10-16 22:51:57.103455879 +0200 +@@ -479,7 +480,7 @@ + int nolineofsight = 1; + + // Do we have line of sight to the VIP? +- if (route((int)c.mX, (int)c.mY, (int)Game.characters[c.mTarget].mX, (int)Game.characters[c.mTarget].mY)) ++ if (c.mTarget != -1 && route((int)c.mX, (int)c.mY, (int)Game.characters[c.mTarget].mX, (int)Game.characters[c.mTarget].mY)) + { + nolineofsight = 0; + // Calculate new vector to it +@@ -541,7 +542,30 @@ + { + // Find a new waypoint + +- if (nolineofsight) ++ if (c.mTarget == -1) ++ { ++ int oldWaypoint = c.mNextWaypoint; ++ ++ // just choose the next-closest waypoint in the area (I know: we'll cycle). ++ c.mNextWaypoint = 0; ++ int i; ++ float dist = distance_wp(0, c.mX, c.mY); ++ for (i = 1; i < Game.num_waypoints; i++) ++ { ++ if (i != oldWaypoint) { ++ float newdist = distance_wp(i, c.mX, c.mY); ++ if (newdist < dist && route(Game.waypoints[i].mX, Game.waypoints[i].mY, (int)c.mX, (int)c.mY)) ++ { ++ dist = newdist; ++ c.mNextWaypoint = i; ++ } ++ } ++ } ++ // Calculate vector towards the closest waypoint ++ c.mXi = ((Game.waypoints[c.mNextWaypoint].mX - c.mX) / dist) * c.mSpeed; ++ c.mYi = ((Game.waypoints[c.mNextWaypoint].mY - c.mY) / dist) * c.mSpeed; ++ } ++ else if (nolineofsight) + { + // Can't see the VIP, try to figure out the closest waypoint to target that's connected from here + int next = 0; + |