mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-04-22 01:52:43 +00:00
check texInfo so mods can't spoof it in smlua_to_texture_info
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
This commit is contained in:
parent
73db1b0345
commit
b99f18dacc
1 changed files with 6 additions and 12 deletions
|
|
@ -270,21 +270,15 @@ struct TextureInfo *smlua_to_texture_info(lua_State *L, int index) {
|
|||
|
||||
lua_pushstring(L, "texture");
|
||||
lua_gettable(L, top + 1);
|
||||
tmpTexInfo.texture = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
||||
const u8 *texPtr = smlua_to_cpointer(L, lua_gettop(L), LVT_U8_P);
|
||||
lua_pop(L, 1);
|
||||
if (!gSmLuaConvertSuccess) { return NULL; }
|
||||
|
||||
tmpTexInfo.bitSize = smlua_get_integer_field(top + 1, "bitSize");
|
||||
if (!gSmLuaConvertSuccess) { return NULL; }
|
||||
|
||||
tmpTexInfo.width = smlua_get_integer_field(top + 1, "width");
|
||||
if (!gSmLuaConvertSuccess) { return NULL; }
|
||||
|
||||
tmpTexInfo.height = smlua_get_integer_field(top + 1, "height");
|
||||
if (!gSmLuaConvertSuccess) { return NULL; }
|
||||
|
||||
tmpTexInfo.name = smlua_get_string_field(top + 1, "name");
|
||||
if (!gSmLuaConvertSuccess) { return NULL; }
|
||||
// Get the texInfo from DynOS so mods can't spoof it
|
||||
if (!texPtr || !dynos_texture_get_from_data(texPtr, texInfo)) {
|
||||
gSmLuaConvertSuccess = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lua_settop(L, top);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue