[+] Implemented Andrettin's patch for GetPlayerData: https://bugs.launchpad.net/stratagus/+bug/1331788
This commit is contained in:
parent
800c6ef6d1
commit
51647d9be9
1 changed files with 9 additions and 0 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "unittype.h"
|
||||
#include "unit.h"
|
||||
#include "unit_find.h"
|
||||
#include "upgrade.h"
|
||||
#include "video.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
|
@ -742,6 +743,14 @@ static int CclGetPlayerData(lua_State *l)
|
|||
} else if (!strcmp(data, "SpeedResearch")) {
|
||||
lua_pushnumber(l, p->SpeedResearch);
|
||||
return 1;
|
||||
} else if (!strcmp(data, "Allow")) {
|
||||
LuaCheckArgs(l, 3);
|
||||
const std::string ident = LuaToString(l, 3);
|
||||
char b[2];
|
||||
b[0] = UpgradeIdentAllowed(Players[p->Index], ident.c_str());
|
||||
b[1] = 0;
|
||||
lua_pushstring(l, b);
|
||||
return 1;
|
||||
} else {
|
||||
LuaError(l, "Invalid field: %s" _C_ data);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue