changeset 3407 | dcc129c4352e |
parent 3346 | 967fd96f7373 |
child 3617 | 1df21e06b8ba |
3406:f4bdebced042 | 3407:dcc129c4352e |
---|---|
35 function GetLastConsoleLine: shortstring; |
35 function GetLastConsoleLine: shortstring; |
36 |
36 |
37 procedure doPut(putX, putY: LongInt; fromAI: boolean); |
37 procedure doPut(putX, putY: LongInt; fromAI: boolean); |
38 |
38 |
39 implementation |
39 implementation |
40 uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, uLand, |
40 uses uMisc, uStore, Types, uConsts, uGears, uTeams, uIO, uKeys, uWorld, |
41 uRandom, uAmmos, uStats, uGame, uChat, SDLh, uSound, uVisualGears, uScript; |
41 uRandom, uAmmos, uStats, uChat, SDLh, uSound, uVisualGears, uScript; |
42 |
42 |
43 const cLineWidth: LongInt = 0; |
43 const cLineWidth: LongInt = 0; |
44 cLinesCount = 256; |
44 cLinesCount = 256; |
45 |
45 |
46 type PVariable = ^TVariable; |
46 type PVariable = ^TVariable; |
130 CurrLine:= 0; |
130 CurrLine:= 0; |
131 PByte(@ConsoleLines[CurrLine].s)^:= 0 |
131 PByte(@ConsoleLines[CurrLine].s)^:= 0 |
132 end; |
132 end; |
133 |
133 |
134 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
134 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean); |
135 type PhwFloat = ^hwFloat; |
|
136 var ii: LongInt; |
135 var ii: LongInt; |
137 s: shortstring; |
136 s: shortstring; |
138 t: PVariable; |
137 t: PVariable; |
139 c: char; |
138 c: char; |
140 begin |
139 begin |
141 //WriteLnToConsole(CmdStr); |
140 //WriteLnToConsole(CmdStr); |
142 if CmdStr[0]=#0 then exit; |
141 if CmdStr[0]=#0 then exit; |
143 {$IFDEF DEBUGFILE}AddFileLog('ParseCommand "' + CmdStr + '"');{$ENDIF} |
142 {$IFDEF DEBUGFILE}AddFileLog('ParseCommand "' + CmdStr + '"');{$ENDIF} |
144 c:= CmdStr[1]; |
143 c:= CmdStr[1]; |
145 if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/'; |
144 if c in ['/', '$'] then Delete(CmdStr, 1, 1) else c:= '/'; |
145 s:= ''; |
|
146 SplitBySpace(CmdStr, s); |
146 SplitBySpace(CmdStr, s); |
147 t:= Variables; |
147 t:= Variables; |
148 while t <> nil do |
148 while t <> nil do |
149 begin |
149 begin |
150 if t^.Name = CmdStr then |
150 if t^.Name = CmdStr then |