Skip to content

Commit

Permalink
xrGame/ui_export_script.cpp: fixed compilation
Browse files Browse the repository at this point in the history
xrGameSpy/GameSpy_Browser.cpp: fixed mistake
  • Loading branch information
Xottab-DUTY committed Oct 10, 2018
1 parent 1d05fb0 commit e0b77e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions src/xrGame/ui_export_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ using namespace luabind;

CMainMenu* MainMenu();

SCRIPT_EXPORT(UIRegistrator, (), {
module(luaState)[class_<CGameFont>("CGameFont")
.enum_("EAligment")[value("alLeft", int(CGameFont::alLeft)),
value("alRight", int(CGameFont::alRight)), value("alCenter", int(CGameFont::alCenter))],
ICF static void UIRegistratorScriptExport(lua_State* luaState)
{
module(luaState)
[
class_<CGameFont>("CGameFont")
.enum_("EAligment")
[
value("alLeft", int(CGameFont::alLeft)),
value("alRight", int(CGameFont::alRight)),
value("alCenter", int(CGameFont::alCenter))
],

class_<Patch_Dawnload_Progress>("Patch_Dawnload_Progress")
.def("GetInProgress", &Patch_Dawnload_Progress::GetInProgress)
Expand All @@ -37,6 +44,10 @@ SCRIPT_EXPORT(UIRegistrator, (), {
.def("GetAccountMngr", &CMainMenu::GetAccountMngr)
.def("GetProfileStore", &CMainMenu::GetProfileStore)
#endif
];
module(luaState, "main_menu")[def("get_main_menu", &MainMenu)];
});
];
module(luaState, "main_menu")
[
def("get_main_menu", &MainMenu)
];
}
SCRIPT_EXPORT_FUNC(UIRegistrator, (), UIRegistratorScriptExport)
2 changes: 1 addition & 1 deletion src/xrGameSpy/GameSpy_Browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void CGameSpy_Browser::ReadServerInfo(ServerInfo* pServerInfo, void* gsServer)
{
PlayerInfo PInfo;
snprintf(
PInfo.Name, "%s", SBServerGetPlayerStringValueA(pServer, i, "player", "Unknown"));
PInfo.Name, sizeof(PInfo.Name) - 1, "%s", SBServerGetPlayerStringValueA(pServer, i, "player", "Unknown"));
PInfo.Name[sizeof(PInfo.Name) - 1] = 0;
PInfo.Frags = s16(SBServerGetPlayerIntValueA(pServer, i, "score", 0));
PInfo.Deaths = u16(SBServerGetPlayerIntValueA(pServer, i, "deaths", 0));
Expand Down

0 comments on commit e0b77e6

Please sign in to comment.