Bug 1081 - Segmentation fault in sudden death situations
Status: RESOLVED FIXED
Alias: None
Product: Orbital Eunuchs Sniper
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: PC Linux
: P2 major
Assignee: Zachary J. Slater
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2003-12-21 21:47 EST by Simon Koch
Modified: 2004-10-23 17:33:34 EDT
0 users

See Also:


Attachments
checks that c.mTarget != -1 before code that uses it as an array index (8.47 KB, patch)
2003-12-21 21:49 EST, Simon Koch
fixes segfault when there are no VIPs (1.81 KB, patch)
2004-10-16 17:04 EDT, Florian Loitsch

Description Simon Koch 2003-12-21 21:47:33 EST
The game segfaults in ai.cpp:482 whenever a sudden death situation happens, 
since c.mTarget is set to -1 at line 469, but the subsequent code tries to use 
it as an array index.  I wrote a patch that seems to fix it without breaking 
the AI.  Basically, it makes the terrorist stand still while the VIP runs away.  
I'll attach it.
Comment 1 Simon Koch 2003-12-21 21:49:19 EST
Created attachment 155 [details]
checks that c.mTarget != -1 before code that uses it as an array index
Comment 2 Florian Loitsch 2004-10-16 17:04:04 EDT
Created attachment 511 [details]
fixes segfault when there are no VIPs

don't know, if this is intended or not, but between my first VIP, and the
second, there is a pause of several seconds. If (as the previous patch did)
the terrorists are not moving, they are too easy to wipe out.
This patch lets the terrorists still move.
Comment 3 Simon Koch 2004-10-16 21:21:04 EDT
Yes, that patch is much better.  Mine was just a quick hack so that I could 
keep playing :) 
Comment 4 Zachary J. Slater 2004-10-23 17:33:34 EDT
Applied the patch. Thanks, closing as fixed.