Ensure that lander explosion element gets allocated; bug #584

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3192 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-10-08 00:07:52 +00:00
parent 009fd85914
commit f619b0b8e1
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.7:
- Lander will no longer hang when killed on planets with a lot of
natural disasters (bug #584) - Alex
- Canceling load from the main menu returns to main menu (bug #679) - Alex
- Fixed inputting numbers with the numpad, except directx (bug #934) - Alex
- Better location description in savegame summaries (bug #844) - Alex
+10 -1
View File
@@ -31,6 +31,7 @@
#include "element.h"
#include "libs/graphics/gfx_common.h"
#include "libs/mathlib.h"
#include "libs/log.h"
//define SPIN_ON_LAUNCH to let the planet spin while
@@ -1660,12 +1661,14 @@ SetVelocityComponents (
{
HELEMENT hExplosionElement;
++pMS->CurState;
hExplosionElement = AllocElement ();
if (hExplosionElement)
{
ELEMENT *ExplosionElementPtr;
// Advance the state only once we've got the element
++pMS->CurState;
LockElement (hExplosionElement, &ExplosionElementPtr);
ExplosionElementPtr->mass_points = DEATH_EXPLOSION;
@@ -1692,6 +1695,12 @@ SetVelocityComponents (
LanderSounds, LANDER_DESTROYED
), NotPositional (), NULL, GAME_SOUND_PRIORITY + 1);
}
else
{ // We could not allocate because the queue was full, but
// we will get another chance on the next iteration
log_add (log_Warning, "DoPlanetSide(): could not"
" allocate explosion element!");
}
}
ScrollPlanetSide (0, 0, -1);