Tutorial: clear user-given obj type names
This commit is contained in:
@@ -1652,6 +1652,7 @@ nhl_gamestate(lua_State *L)
|
|||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
int argc = lua_gettop(L);
|
int argc = lua_gettop(L);
|
||||||
boolean reststate = (argc > 0) ? lua_toboolean(L, -1) : FALSE;
|
boolean reststate = (argc > 0) ? lua_toboolean(L, -1) : FALSE;
|
||||||
|
int otyp;
|
||||||
|
|
||||||
debugpline4("gamestate: %d:%d (%c vs %c)", u.uz.dnum, u.uz.dlevel,
|
debugpline4("gamestate: %d:%d (%c vs %c)", u.uz.dnum, u.uz.dlevel,
|
||||||
reststate ? 'T' : 'F', gg.gmst_stored ? 't' : 'f');
|
reststate ? 'T' : 'F', gg.gmst_stored ? 't' : 'f');
|
||||||
@@ -1683,6 +1684,12 @@ nhl_gamestate(lua_State *L)
|
|||||||
assert(gg.gmst_mvitals != NULL);
|
assert(gg.gmst_mvitals != NULL);
|
||||||
(void) memcpy((genericptr_t) &svm.mvitals, gg.gmst_mvitals,
|
(void) memcpy((genericptr_t) &svm.mvitals, gg.gmst_mvitals,
|
||||||
sizeof svm.mvitals);
|
sizeof svm.mvitals);
|
||||||
|
/* clear user-given object type names */
|
||||||
|
for (otyp = 0; otyp < NUM_OBJECTS; otyp++)
|
||||||
|
if (objects[otyp].oc_uname) {
|
||||||
|
free(objects[otyp].oc_uname);
|
||||||
|
objects[otyp].oc_uname = (char *) 0;
|
||||||
|
}
|
||||||
/* some restored state would confuse the level change in progress */
|
/* some restored state would confuse the level change in progress */
|
||||||
u.uz = cur_uz, u.uz0 = cur_uz0;
|
u.uz = cur_uz, u.uz0 = cur_uz0;
|
||||||
init_uhunger();
|
init_uhunger();
|
||||||
|
|||||||
Reference in New Issue
Block a user