Skip to content

Commit e0b77e6

Browse files
committed
xrGame/ui_export_script.cpp: fixed compilation
xrGameSpy/GameSpy_Browser.cpp: fixed mistake
1 parent 1d05fb0 commit e0b77e6

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/xrGame/ui_export_script.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@ using namespace luabind;
1313

1414
CMainMenu* MainMenu();
1515

16-
SCRIPT_EXPORT(UIRegistrator, (), {
17-
module(luaState)[class_<CGameFont>("CGameFont")
18-
.enum_("EAligment")[value("alLeft", int(CGameFont::alLeft)),
19-
value("alRight", int(CGameFont::alRight)), value("alCenter", int(CGameFont::alCenter))],
16+
ICF static void UIRegistratorScriptExport(lua_State* luaState)
17+
{
18+
module(luaState)
19+
[
20+
class_<CGameFont>("CGameFont")
21+
.enum_("EAligment")
22+
[
23+
value("alLeft", int(CGameFont::alLeft)),
24+
value("alRight", int(CGameFont::alRight)),
25+
value("alCenter", int(CGameFont::alCenter))
26+
],
2027

2128
class_<Patch_Dawnload_Progress>("Patch_Dawnload_Progress")
2229
.def("GetInProgress", &Patch_Dawnload_Progress::GetInProgress)
@@ -37,6 +44,10 @@ SCRIPT_EXPORT(UIRegistrator, (), {
3744
.def("GetAccountMngr", &CMainMenu::GetAccountMngr)
3845
.def("GetProfileStore", &CMainMenu::GetProfileStore)
3946
#endif
40-
];
41-
module(luaState, "main_menu")[def("get_main_menu", &MainMenu)];
42-
});
47+
];
48+
module(luaState, "main_menu")
49+
[
50+
def("get_main_menu", &MainMenu)
51+
];
52+
}
53+
SCRIPT_EXPORT_FUNC(UIRegistrator, (), UIRegistratorScriptExport)

src/xrGameSpy/GameSpy_Browser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void CGameSpy_Browser::ReadServerInfo(ServerInfo* pServerInfo, void* gsServer)
328328
{
329329
PlayerInfo PInfo;
330330
snprintf(
331-
PInfo.Name, "%s", SBServerGetPlayerStringValueA(pServer, i, "player", "Unknown"));
331+
PInfo.Name, sizeof(PInfo.Name) - 1, "%s", SBServerGetPlayerStringValueA(pServer, i, "player", "Unknown"));
332332
PInfo.Name[sizeof(PInfo.Name) - 1] = 0;
333333
PInfo.Frags = s16(SBServerGetPlayerIntValueA(pServer, i, "score", 0));
334334
PInfo.Deaths = u16(SBServerGetPlayerIntValueA(pServer, i, "deaths", 0));

0 commit comments

Comments
 (0)