I added random damage infliction at the start of the DoDamage function in the Unit class. Now the game crashes when I destroy an enemy building. I run the game in Debug and the game doesn't crash.
However I do get this message in Debug mode: "Delayed sync response..."
My random damage code:
srand ( time(NULL) );
int random_integer;
random_integer = (int)rand()% (int)damage/2+(int)damage/2;
*info <<"Initial Damage: " << damage << " Random Damage: " << random_integer <<"\n";
damage = random_integer;
Does anyone have an idea what Im doing wrong?
[EDIT]
The game stoped crashing after I replaced rand() with RandFloat()
[solved] Crash in Release but not while Debugging
Moderator: Moderators
[solved] Crash in Release but not while Debugging
Last edited by pin_ on 23 Sep 2006, 20:23, edited 1 time in total.