X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_triggers.pas;h=ad03070e45eb91cb4ccaaaf80a01ddf2f6382c30;hb=5e6afeb0eca1550854b9d17269e707e984cb0f21;hp=c1516535c11decd0fc4a9dad7c23044479811b23;hpb=3349a0b38bc1fae71b758cb1686d4f6d0bf4f926;p=d2df-sdl.git diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index c151653..ad03070 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -69,7 +69,7 @@ procedure g_Triggers_Press(ID: DWORD; ActivateType: Byte; ActivateUID: Word = 0) function g_Triggers_PressR(X, Y: Integer; Width, Height: Word; UID: Word; ActivateType: Byte; IgnoreList: DWArray = nil): DWArray; procedure g_Triggers_PressL(X1, Y1, X2, Y2: Integer; UID: DWORD; ActivateType: Byte); -procedure g_Triggers_PressC(CX, CY: Integer; Radius: Word; UID: Word; ActivateType: Byte); +procedure g_Triggers_PressC(CX, CY: Integer; Radius: Word; UID: Word; ActivateType: Byte; IgnoreTrigger: Integer = -1); procedure g_Triggers_OpenAll(); procedure g_Triggers_DecreaseSpawner(ID: DWORD); procedure g_Triggers_Free(); @@ -435,6 +435,7 @@ var Anim: TAnimation; begin Result := -1; + TextureID := DWORD(-1); snd := 'SOUND_WEAPON_FIREROCKET'; Projectile := True; case ShotType of @@ -731,8 +732,8 @@ begin if D2D then begin - if m.TeleportTo(TX-(p.Obj.Rect.Width div 2), - TY-p.Obj.Rect.Height, + if m.TeleportTo(TX-(m.Obj.Rect.Width div 2), + TY-m.Obj.Rect.Height, Silent, TDir) then Result := True; @@ -1828,6 +1829,9 @@ begin 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); @@ -1956,8 +1960,6 @@ begin end; end; end; - - TimeOut := Data.ShotWait + 1; end; TRIGGER_EFFECT: @@ -2472,7 +2474,7 @@ begin end; end; -procedure g_Triggers_PressC(CX, CY: Integer; Radius: Word; UID: Word; ActivateType: Byte); +procedure g_Triggers_PressC(CX, CY: Integer; Radius: Word; UID: Word; ActivateType: Byte; IgnoreTrigger: Integer = -1); var a: Integer; k: Byte; @@ -2498,7 +2500,8 @@ begin rsq := Radius * Radius; for a := 0 to High(gTriggers) do - if (gTriggers[a].TriggerType <> TRIGGER_NONE) and + if (gTriggers[a].ID <> DWORD(IgnoreTrigger)) 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