mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-01-10 08:44:22 +00:00
served time for crimes against C
This commit is contained in:
parent
d07e31de49
commit
bfdbbea175
1 changed files with 6 additions and 6 deletions
|
|
@ -349,7 +349,7 @@ bool packet_read_lnt(struct Packet* p, struct LSTNetworkType* lnt) {
|
|||
CObject *smlua_push_object(lua_State* L, u16 lot, void* p, void *extraInfo) {
|
||||
if (p == NULL) {
|
||||
lua_pushnil(L);
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
LUA_STACK_CHECK_BEGIN_NUM(1);
|
||||
|
||||
|
|
@ -358,10 +358,10 @@ CObject *smlua_push_object(lua_State* L, u16 lot, void* p, void *extraInfo) {
|
|||
lua_pushinteger(L, key);
|
||||
lua_gettable(L, -2);
|
||||
if (lua_isuserdata(L, -1)) {
|
||||
const CObject *cobj = lua_touserdata(L, -1);
|
||||
CObject *cobj = lua_touserdata(L, -1);
|
||||
if (cobj && cobj->lot == lot && cobj->pointer == p) {
|
||||
lua_remove(L, -2); // Remove gSmLuaCObjects table
|
||||
return;
|
||||
return cobj;
|
||||
}
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
|
@ -386,7 +386,7 @@ CObject *smlua_push_object(lua_State* L, u16 lot, void* p, void *extraInfo) {
|
|||
CPointer *smlua_push_pointer(lua_State* L, u16 lvt, void* p, void *extraInfo) {
|
||||
if (p == NULL) {
|
||||
lua_pushnil(L);
|
||||
return;
|
||||
return NULL;
|
||||
}
|
||||
LUA_STACK_CHECK_BEGIN_NUM(1);
|
||||
|
||||
|
|
@ -395,10 +395,10 @@ CPointer *smlua_push_pointer(lua_State* L, u16 lvt, void* p, void *extraInfo) {
|
|||
lua_pushinteger(L, key);
|
||||
lua_gettable(L, -2);
|
||||
if (lua_isuserdata(L, -1)) {
|
||||
const CPointer *cptr = lua_touserdata(L, 1);
|
||||
CPointer *cptr = lua_touserdata(L, 1);
|
||||
if (cptr && cptr->lvt == lvt && cptr->pointer == p) {
|
||||
lua_remove(L, -2); // Remove gSmLuaCPointers table
|
||||
return;
|
||||
return cptr;
|
||||
}
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue