# HG changeset patch # User unc0rr # Date 1290355663 -10800 # Node ID 9cb6990af584ecb28fb6f230f67f6ba4c00a9488 # Parent b190572290a02aa8de9f99e0dc149257b41a401c Remove uAmmos dependaency from uCommands diff -r b190572290a0 -r 9cb6990af584 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sun Nov 21 10:53:50 2010 -0500 +++ b/hedgewars/CCHandlers.inc Sun Nov 21 19:07:43 2010 +0300 @@ -116,46 +116,6 @@ end; end; -procedure chSetAmmoLoadout(var descr: shortstring); -begin -SetAmmoLoadout(descr) -end; - -procedure chSetAmmoDelay(var descr: shortstring); -begin -SetAmmoDelay(descr) -end; - -procedure chSetAmmoProbability(var descr: shortstring); -begin -SetAmmoProbability(descr) -end; - -procedure chSetAmmoReinforcement(var descr: shortstring); -begin -SetAmmoReinforcement(descr) -end; - -procedure chAddAmmoStore(var descr: shortstring); -begin -descr:= ''; // avoid compiler hint -AddAmmoStore -end; - -procedure chBind(var id: shortstring); -var s: shortstring; - b: LongInt; -begin -s:= ''; -if CurrentTeam = nil then exit; -SplitBySpace(id, s); -if s[1]='"' then Delete(s, 1, 1); -if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); -b:= KeyNameToCode(id); -if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false) - else CurrentTeam^.Binds[b]:= s -end; - procedure chCurU_p(var s: shortstring); begin s:= s; // avoid compiler hint diff -r b190572290a0 -r 9cb6990af584 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Sun Nov 21 10:53:50 2010 -0500 +++ b/hedgewars/uAmmos.pas Sun Nov 21 19:07:43 2010 +0300 @@ -418,8 +418,22 @@ if Ammoz[a].SkipTurns >= 10000 then dec(Ammoz[a].SkipTurns,10000) end; + + +procedure chAddAmmoStore(var descr: shortstring); +begin +descr:= ''; // avoid compiler hint +AddAmmoStore +end; + procedure initModule; begin + RegisterVariable('ammloadt', vtCommand, @SetAmmoLoadout, false); + RegisterVariable('ammdelay', vtCommand, @SetAmmoDelay, false); + RegisterVariable('ammprob', vtCommand, @SetAmmoProbability, false); + RegisterVariable('ammreinf', vtCommand, @SetAmmoReinforcement, false); + RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); + StoreCnt:= 0; ammoLoadout:= ''; ammoProbability:= ''; diff -r b190572290a0 -r 9cb6990af584 hedgewars/uCommands.pas --- a/hedgewars/uCommands.pas Sun Nov 21 10:53:50 2010 -0500 +++ b/hedgewars/uCommands.pas Sun Nov 21 19:07:43 2010 +0300 @@ -16,8 +16,8 @@ procedure doPut(putX, putY: LongInt; fromAI: boolean); implementation -uses Types, uConsts, uIO, uKeys, uMobile, - uRandom, uAmmos, uChat, SDLh, uScript, uTypes, +uses Types, uConsts, uIO, uMobile, + uRandom, uChat, SDLh, uScript, uTypes, uVariables, uConsole, uUtils; type PVariable = ^TVariable; @@ -146,7 +146,6 @@ RegisterVariable('waterrise', vtLongInt, @cWaterRise , false); RegisterVariable('healthdec', vtLongInt, @cHealthDecrease, false); RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false); - RegisterVariable('ropepct' , vtLongInt, @cRopePercent , false); RegisterVariable('minedudpct',vtLongInt,@cMineDudPercent, false); RegisterVariable('minesnum', vtLongInt, @cLandMines , false); RegisterVariable('explosives',vtLongInt,@cExplosives , false); @@ -156,13 +155,7 @@ RegisterVariable('minestime',vtLongInt, @cMinesTime , false); RegisterVariable('fort' , vtCommand, @chFort , false); RegisterVariable('grave' , vtCommand, @chGrave , false); - RegisterVariable('bind' , vtCommand, @chBind , true ); RegisterVariable('hat' , vtCommand, @chSetHat , false); - RegisterVariable('ammloadt', vtCommand, @chSetAmmoLoadout, false); - RegisterVariable('ammdelay', vtCommand, @chSetAmmoDelay, false); - RegisterVariable('ammprob', vtCommand, @chSetAmmoProbability, false); - RegisterVariable('ammreinf', vtCommand, @chSetAmmoReinforcement, false); - RegisterVariable('ammstore', vtCommand, @chAddAmmoStore , false); RegisterVariable('quit' , vtCommand, @chQuit , true ); RegisterVariable('confirm' , vtCommand, @chConfirm , true ); RegisterVariable('+speedup', vtCommand, @chSpeedup_p , true ); @@ -225,4 +218,4 @@ end; end; -end. +end. \ No newline at end of file diff -r b190572290a0 -r 9cb6990af584 hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Sun Nov 21 10:53:50 2010 -0500 +++ b/hedgewars/uTeams.pas Sun Nov 21 19:07:43 2010 +0300 @@ -501,11 +501,26 @@ CurrentHedgehog^.Gear^.Y:= int2hwFloat(t) end; +procedure chBind(var id: shortstring); +var s: shortstring; + b: LongInt; +begin +s:= ''; +if CurrentTeam = nil then exit; +SplitBySpace(id, s); +if s[1]='"' then Delete(s, 1, 1); +if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); +b:= KeyNameToCode(id); +if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false) + else CurrentTeam^.Binds[b]:= s +end; + procedure initModule; begin RegisterVariable('addhh', vtCommand, @chAddHH, false); RegisterVariable('addteam', vtCommand, @chAddTeam, false); - RegisterVariable('hhcoords', vtCommand, @chSetHHCoords , false); + RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false); + RegisterVariable('bind', vtCommand, @chBind, true ); CurrentTeam:= nil; PreviousTeam:= nil;