index 40de5b4d42199ffe0cca71090bec55d38848841a..9ce8c0affc12cd9b8884fa381e40bd8c103ae392 100644 (file)
--- a/src/game/g_triggers.pas
+++ b/src/game/g_triggers.pas
function tr_Push(ActivateUID: Integer; VX, VY: Integer; ResetVel: Boolean): Boolean;
procedure tr_MakeEffect(X, Y, VX, VY: Integer; T, ST, CR, CG, CB: Byte; Silent, Send: Boolean);
-function tr_SpawnShot(ShotType: Integer; wx, wy, dx, dy: Integer; ShotSound: Boolean; ShotTarget: Word; TID: DWORD): Integer;
+function tr_SpawnShot(ShotType: Integer; wx, wy, dx, dy: Integer; ShotSound: Boolean; ShotTarget: Word): Integer;
var
gTriggerClientID: Integer = 0;
end;
end;
-function tr_SpawnShot(ShotType: Integer; wx, wy, dx, dy: Integer; ShotSound: Boolean; ShotTarget: Word; TID: DWORD): Integer;
+function tr_SpawnShot(ShotType: Integer; wx, wy, dx, dy: Integer; ShotSound: Boolean; ShotTarget: Word): Integer;
var
snd: string;
Projectile: Boolean;
Anim.Free();
end;
Projectile := False;
- g_Weapon_Explode(wx, wy, 60, 0, TID);
+ g_Weapon_Explode(wx, wy, 60, 0);
snd := 'SOUND_WEAPON_EXPLODEROCKET';
end;
dx := dx + Random(Data.ShotAccuracy) - Random(Data.ShotAccuracy);
dy := dy + Random(Data.ShotAccuracy) - Random(Data.ShotAccuracy);
- tr_SpawnShot(Data.ShotType, wx, wy, dx, dy, Data.ShotSound, TargetUID, ID);
+ tr_SpawnShot(Data.ShotType, wx, wy, dx, dy, Data.ShotSound, TargetUID);
end
else
if (Data.ShotIntReload > 0) and (ShotReloadTime = 0) then
if ShotSightTime > 0 then
Exit;
+ // put this at the beginning so it doesn't trigger itself
+ TimeOut := Data.ShotWait + 1;
+
wx := Data.ShotPos.X;
wy := Data.ShotPos.Y;
pAngle := -DegToRad(Data.ShotAngle);
end;
end;
- else TargetUID := ActivateUID;
+ else begin
+ if (Data.ShotTarget <> TRIGGER_SHOT_TARGET_NONE) or
+ (Data.ShotType <> TRIGGER_SHOT_REV) then
+ TargetUID := ActivateUID;
+ end;
end;
if (Data.ShotTarget = TRIGGER_SHOT_TARGET_NONE) or (TargetUID > 0) then
end;
end;
end;
-
- TimeOut := Data.ShotWait + 1;
end;
TRIGGER_EFFECT:
for a := 0 to High(gTriggers) do
if (gTriggers[a].ID <> DWORD(IgnoreTrigger)) and
- (gTriggers[a].TriggerType <> TRIGGER_NONE) and
+ (gTriggers[a].TriggerType <> TRIGGER_NONE) and
(gTriggers[a].TimeOut = 0) and
((gTriggers[a].Keys and k) = gTriggers[a].Keys) and
ByteBool(gTriggers[a].ActivateType and ActivateType) then