mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
ArtilleryStrike: supply GetArtilleryLaunchParams with launcher item and not just mortar shell, as it will check it's range later.
Add smoke after explosion: improved code. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8913 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -11893,8 +11893,14 @@ BOOLEAN ArtilleryStrike( UINT16 usItem, UINT8 ubOwnerID, UINT32 usStartingGridNo
|
|||||||
OBJECTTYPE shellobj;
|
OBJECTTYPE shellobj;
|
||||||
CreateItem( usItem, 100, &shellobj );
|
CreateItem( usItem, 100, &shellobj );
|
||||||
|
|
||||||
|
// sevenfm: find launcher for usItem
|
||||||
|
UINT16 usLauncher = GetLauncherFromLaunchable(usItem);
|
||||||
|
if (usLauncher == NOTHING)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
// Get basic launch params...
|
// Get basic launch params...
|
||||||
if (!GetArtilleryLaunchParams(usStartingGridNo, sTargetGridNo, ubLevel, sStartZ, sEndZ, usItem, &shellobj, &dForce, &dDegrees))
|
// sevenfm: we need to supply GetArtilleryLaunchParams with launcher item and not just mortar shell, as it will check it's range later
|
||||||
|
if (!GetArtilleryLaunchParams(usStartingGridNo, sTargetGridNo, ubLevel, sStartZ, sEndZ, usLauncher, &shellobj, &dForce, &dDegrees))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// Get XY from gridno
|
// Get XY from gridno
|
||||||
|
|||||||
@@ -404,26 +404,19 @@ void InternalIgniteExplosion( UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32
|
|||||||
|
|
||||||
// sevenfm: add smoke effect, only for normal explosions
|
// sevenfm: add smoke effect, only for normal explosions
|
||||||
if (gGameExternalOptions.bAddSmokeAfterExplosion &&
|
if (gGameExternalOptions.bAddSmokeAfterExplosion &&
|
||||||
!Water(sGridNo, bLevel))
|
(bLevel == 0 || IsRoofPresentAtGridNo(sGridNo)) &&
|
||||||
|
!Water(sGridNo, bLevel) &&
|
||||||
|
GridNoOnVisibleWorldTile(sGridNo) &&
|
||||||
|
Explosive[Item[usItem].ubClassIndex].ubType == 0 &&
|
||||||
|
Item[usItem].usBuddyItem == 0 &&
|
||||||
|
Explosive[Item[usItem].ubClassIndex].ubDamage > 20)
|
||||||
{
|
{
|
||||||
if (Explosive[Item[usItem].ubClassIndex].ubType == 0 &&
|
UINT16 usSmokeItem = SMOKE_GRENADE;
|
||||||
Item[usItem].usBuddyItem == 0 &&
|
if (HasItemFlag(usItem, JUMP_GRENADE))
|
||||||
Explosive[Item[usItem].ubClassIndex].ubDamage > 20)
|
NewSmokeEffect(sGridNo, usSmokeItem, bLevel, ubOwner, 0, 1, 0);
|
||||||
{
|
else
|
||||||
NewSmokeEffect(sGridNo, SMOKE_GRENADE, bLevel, ubOwner, 0, 2, 1);
|
NewSmokeEffect(sGridNo, usSmokeItem, bLevel, ubOwner, 0, 2, 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sevenfm: add light for fire and signal effects
|
|
||||||
/*if (gGameExternalOptions.bAddLightAfterExplosion &&
|
|
||||||
((gubEnvLightValue >= NORMAL_LIGHTLEVEL_NIGHT - 3) || gbWorldSectorZ) &&
|
|
||||||
(Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_BURNABLEGAS || Explosive[Item[usItem].ubClassIndex].ubType == EXPLOSV_SIGNAL_SMOKE) &&
|
|
||||||
bLevel == 0 &&
|
|
||||||
!Water(sGridNo, bLevel))
|
|
||||||
{
|
|
||||||
// add light
|
|
||||||
NewLightEffect(sGridNo, (UINT8)Explosive[Item[usItem].ubClassIndex].ubDuration + Explosive[Item[usItem].ubClassIndex].ubRadius - Explosive[Item[usItem].ubClassIndex].ubStartRadius, (UINT8)Explosive[Item[usItem].ubClassIndex].ubRadius + 1);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user