backport: Force correct target position for projectiles that are almost off-map. Will prevent crashes on impact for effect-enabled projectiles (flame-based ones). Reported by pranjan in http://forums.wz2100.net/viewtopic.php?f=4&t=4130

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8402 4a71c877-e1ca-e34f-864e-861f7616d084
master
i-nod 2009-11-16 03:09:46 +00:00 committed by Git SVN Gateway
parent 4fe43df6ea
commit 2078410674
1 changed files with 4 additions and 0 deletions

View File

@ -700,6 +700,8 @@ static void proj_InFlightDirectFunc(PROJECTILE *psProj)
if (!worldOnMap(nextPos.x, nextPos.y))
{
psProj->state = PROJ_IMPACT;
psProj->tarX = psProj->pos.x;
psProj->tarY = psProj->pos.y;
setProjectileDestination(psProj, NULL);
debug(LOG_NEVER, "**** projectile(%i) off map - removed ****\n", psProj->id);
return;
@ -927,6 +929,8 @@ static void proj_InFlightIndirectFunc(PROJECTILE *psProj)
if (!worldOnMap(nextPos.x, nextPos.y))
{
psProj->state = PROJ_IMPACT;
psProj->tarX = psProj->pos.x;
psProj->tarY = psProj->pos.y;
setProjectileDestination(psProj, NULL);
debug(LOG_NEVER, "**** projectile(%i) off map - removed ****\n", psProj->id);
return;