# HG changeset patch # User unc0rr # Date 1509565926 -3600 # Node ID 92218a06c9ffb7ed0282800af05920518cb24eb5 # Parent b4e20bb485f90f4806757cc72dcb728981dd2a37 Don't send taunt message for automatically happening taunt animation diff -r b4e20bb485f9 -r 92218a06c9ff hedgewars/uCommandHandlers.pas --- a/hedgewars/uCommandHandlers.pas Wed Nov 01 00:04:45 2017 +0100 +++ b/hedgewars/uCommandHandlers.pas Wed Nov 01 20:52:06 2017 +0100 @@ -27,7 +27,7 @@ implementation uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions - , uVisualGearsList + , uVisualGearsList, uGearsHedgehog {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}; var prevGState: TGameState = gsConfirm; @@ -474,12 +474,7 @@ if not isExternalSource then SendIPC('t' + s); -with CurrentHedgehog^.Gear^ do - begin - Message:= Message or (gmAnimate and InputMask); - MsgParam:= byte(s[1]) ; - ScriptCall('onTaunt', MsgParam); - end +PlayTaunt(byte(s[1])) end; procedure chPut(var s: shortstring); diff -r b4e20bb485f9 -r 92218a06c9ff hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Wed Nov 01 00:04:45 2017 +0100 +++ b/hedgewars/uGearsHandlersMess.pas Wed Nov 01 20:52:06 2017 +0100 @@ -3894,8 +3894,10 @@ end; if HHGear <> nil then + begin HHGear^.Message := 0; - ParseCommand('/taunt ' + #1, true) + PlayTaunt(1) + end end end; diff -r b4e20bb485f9 -r 92218a06c9ff hedgewars/uGearsHedgehog.pas --- a/hedgewars/uGearsHedgehog.pas Wed Nov 01 00:04:45 2017 +0100 +++ b/hedgewars/uGearsHedgehog.pas Wed Nov 01 20:52:06 2017 +0100 @@ -30,6 +30,7 @@ procedure PickUp(HH, Gear: PGear); procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord); procedure CheckIce(Gear: PGear); inline; +procedure PlayTaunt(taunt: Longword); implementation uses uConsts, uVariables, uFloat, uAmmos, uSound, uCaptions, @@ -1551,4 +1552,15 @@ end; end; +procedure PlayTaunt(taunt: Longword); +begin + if CurrentHedgehog^.Gear <> nil then + with CurrentHedgehog^.Gear^ do + begin + Message:= Message or (gmAnimate and InputMask); + MsgParam:= taunt; + ScriptCall('onTaunt', MsgParam); + end +end; + end.