diff -r 73b0bcc4396d -r 7845c77c8d31 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sun Apr 26 15:47:03 2009 +0000 +++ b/hedgewars/CCHandlers.inc Thu Apr 30 20:13:44 2009 +0000 @@ -390,6 +390,35 @@ end end; +procedure chHogSay(var s: shortstring); +var Gear: PGear; + text: shortstring; +begin +text:= copy(s, 2, Length(s)-1); +if CheckNoTeamOrHH or ((CurrentHedgehog^.Gear^.State and gstHHDriven) = 0) then + begin + chSay(text); + exit + end; + +if not CurrentTeam^.ExtDriven then SendIPC('h' + s); +if byte(s[1]) < 4 then + begin + Gear:= AddGear(0, 0, gtSpeechBubble, 0, _0, _0, 0); + Gear^.Text:= text; + Gear^.Hedgehog:= CurrentHedgehog; + Gear^.State:= byte(s[1]); + end +else + begin + // If I knew how to add a gear without it becoming immediately active, I'd + // just create/attach the hedgehog SpeechGear here, then activate it where + // SpeechType/SpeechText are activated + SpeechType:= byte(s[1]); + SpeechText:= text + end; +end; + procedure chNewGrave; begin if CheckNoTeamOrHH then exit;