Add GameData methodmap (#766)
This commit is contained in:
committed by
Michael Flaherty
parent
ccfd2ffe38
commit
1b795a70b0
@@ -67,7 +67,10 @@ static cell_t smn_LoadGameConfigFile(IPluginContext *pCtx, const cell_t *params)
|
||||
return pCtx->ThrowNativeError("Unable to open %s: %s", filename, error);
|
||||
}
|
||||
|
||||
return handlesys->CreateHandle(g_GameConfigsType, gc, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
||||
Handle_t hndl = handlesys->CreateHandle(g_GameConfigsType, gc, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
||||
if (hndl == BAD_HANDLE)
|
||||
g_GameConfigs.CloseGameConfigFile(gc);
|
||||
return hndl;
|
||||
}
|
||||
|
||||
static cell_t smn_GameConfGetOffset(IPluginContext *pCtx, const cell_t *params)
|
||||
@@ -167,5 +170,11 @@ REGISTER_NATIVES(gameconfignatives)
|
||||
{"GameConfGetOffset", smn_GameConfGetOffset},
|
||||
{"GameConfGetKeyValue", smn_GameConfGetKeyValue},
|
||||
{"GameConfGetAddress", smn_GameConfGetAddress},
|
||||
|
||||
// Transitional syntax support.
|
||||
{"GameData.GameData", smn_LoadGameConfigFile},
|
||||
{"GameData.GetOffset", smn_GameConfGetOffset},
|
||||
{"GameData.GetKeyValue", smn_GameConfGetKeyValue},
|
||||
{"GameData.GetAddress", smn_GameConfGetAddress},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user