Hedgehog drops a grave on "/newgrave" command. Patch by nemo
authorunc0rr
Sat, 21 Feb 2009 14:43:40 +0000
changeset 1821 6b6cf3389f92
parent 1820 ae428043da32
child 1822 be7105bc727d
Hedgehog drops a grave on "/newgrave" command. Patch by nemo
hedgewars/CCHandlers.inc
hedgewars/uChat.pas
hedgewars/uConsole.pas
hedgewars/uIO.pas
--- a/hedgewars/CCHandlers.inc	Sat Feb 21 14:40:35 2009 +0000
+++ b/hedgewars/CCHandlers.inc	Sat Feb 21 14:43:40 2009 +0000
@@ -390,6 +390,15 @@
      end
 end;
 
+procedure chNewGrave;
+begin
+if CheckNoTeamOrHH then exit;
+
+if not CurrentTeam^.ExtDriven then SendIPC('g');
+
+AddGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), gtGrave, 0, _0, _0, 0)
+end;
+
 procedure doPut(putX, putY: LongInt; fromAI: boolean);
 begin
 if CheckNoTeamOrHH then exit;
--- a/hedgewars/uChat.pas	Sat Feb 21 14:40:35 2009 +0000
+++ b/hedgewars/uChat.pas	Sat Feb 21 14:43:40 2009 +0000
@@ -142,6 +142,8 @@
 			ParseCommand('/taunt ' + char(i), true);
 			exit
 			end;
+	if (s = '/newgrave') then
+	    ParseCommand('/newgrave', true);
 	end
 	else
 		ParseCommand('/say ' + s, true);
@@ -181,7 +183,7 @@
 			63235 is RIGHT
 			63233 is DOWN
 		*}
-		63272, 63232, 36233, 36234, 36235: Key:=28;
+		63272, 63232, 36233, 36234, 36235: Key:= 28;
 	else
 	if (Key < $80) then btw:= 1
 	else if (Key < $800) then btw:= 2
--- a/hedgewars/uConsole.pas	Sat Feb 21 14:40:35 2009 +0000
+++ b/hedgewars/uConsole.pas	Sat Feb 21 14:43:40 2009 +0000
@@ -260,6 +260,7 @@
 RegisterVariable('skip'    , vtCommand, @chSkip         , false);
 RegisterVariable('history' , vtCommand, @chHistory      , true );
 RegisterVariable('chat'    , vtCommand, @chChat         , true );
+RegisterVariable('newgrave', vtCommand, @chNewGrave     , false);
 RegisterVariable('say'     , vtCommand, @chSay          , true );
 RegisterVariable('ammomenu', vtCommand, @chAmmoMenu     , false);
 RegisterVariable('+precise', vtCommand, @chPrecise_p    , false);
--- a/hedgewars/uIO.pas	Sat Feb 21 14:40:35 2009 +0000
+++ b/hedgewars/uIO.pas	Sat Feb 21 14:43:40 2009 +0000
@@ -260,6 +260,7 @@
 			end;
 		'w': ParseCommand('setweap ' + headcmd^.str[2], true);
 		't': ParseCommand('taunt ' + headcmd^.str[2], true);
+		'g': ParseCommand('newgrave', true);
 		'1'..'5': ParseCommand('timer ' + headcmd^.cmd, true);
 		#128..char(128 + cMaxSlotIndex): ParseCommand('slot ' + char(byte(headcmd^.cmd) - 79), true)
 		else