# HG changeset patch
# User nemo
# Date 1296330848 18000
# Node ID b4c84db92d8ff19910cd8809932408dd341708c9
# Parent  35e6269227b67a98c86b184e3e3de83cb56b5767
expose set clan color for Cairo. might also be useful for betrayals in campaign mode or somesuch

diff -r 35e6269227b6 -r b4c84db92d8f hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sat Jan 29 18:18:44 2011 +0100
+++ b/hedgewars/uScript.pas	Sat Jan 29 14:54:08 2011 -0500
@@ -548,6 +548,15 @@
     lc_getclancolor:= 1
 end;
 
+function lc_setclancolor(L : Plua_State) : LongInt; Cdecl;
+var gear : PGear;
+begin
+    if lua_gettop(L) <> 2 then
+        LuaError('Lua: Wrong number of parameters passed to SetClanColor!')
+    else ClansArray[lua_tointeger(L, 1)]^.Color:= lua_tointeger(L, 2) shr 8;
+    lc_setclancolor:= 0
+end;
+
 function lc_gethogteamname(L : Plua_State) : LongInt; Cdecl;
 var gear : PGear;
 begin
@@ -1604,6 +1613,7 @@
 lua_register(luaState, 'SetEffect', @lc_seteffect);
 lua_register(luaState, 'GetHogClan', @lc_gethogclan);
 lua_register(luaState, 'GetClanColor', @lc_getclancolor);
+lua_register(luaState, 'SetClanColor', @lc_setclancolor);
 lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname);
 lua_register(luaState, 'GetHogName', @lc_gethogname);
 lua_register(luaState, 'GetHogLevel', @lc_gethoglevel);