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-861f7616d084master
parent
4fe43df6ea
commit
2078410674
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue