hedgewars/uScript.pas
changeset 3271 0405e07ca44b
parent 3209 4533c6e02240
child 3337 75e7455c69ed
--- a/hedgewars/uScript.pas	Fri Apr 02 22:44:14 2010 +0000
+++ b/hedgewars/uScript.pas	Fri Apr 02 23:00:56 2010 +0000
@@ -423,6 +423,7 @@
 end;
 
 function lc_addhog(L : Plua_State) : LongInt; Cdecl;
+var temp: ShortString;
 begin
     if lua_gettop(L) <> 4 then
         begin
@@ -431,8 +432,9 @@
         end
     else
         begin
+        temp:= lua_tostring(L, 4);
         ParseCommand('addhh ' + lua_tostring(L, 2) + ' ' + lua_tostring(L, 3) + ' ' + lua_tostring(L, 1), true);
-        ParseCommand('hat ' + lua_tostring(L, 4), true);
+        ParseCommand('hat ' + temp, true);
         lua_pushinteger(L, CurrentHedgehog^.Gear^.uid);
         end;
     lc_addhog:= 1;