From 5846aee283da673b2554427d07c86f9ee9749cf2 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 28 Dec 2018 15:06:45 -0800 Subject: [PATCH] memory #stats obj->oextra->omonst might contain monst->mextra plus mextra->edog, &c. That was being ignored when summing up memory allocated for objects. --- src/cmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index f05787fe3..04df10458 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 cmd.c $NHDT-Date: 1545128652 2018/12/18 10:24:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.322 $ */ +/* NetHack 3.6 cmd.c $NHDT-Date: 1546038393 2018/12/28 23:06:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.323 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3664,18 +3664,18 @@ STATIC_OVL int size_obj(otmp) struct obj *otmp; { - int sz = (int) sizeof(struct obj); + int sz = (int) sizeof (struct obj); if (otmp->oextra) { - sz += (int) sizeof(struct oextra); + sz += (int) sizeof (struct oextra); if (ONAME(otmp)) sz += (int) strlen(ONAME(otmp)) + 1; if (OMONST(otmp)) - sz += (int) sizeof(struct monst); + sz += size_monst(OMONST(otmp), FALSE); if (OMID(otmp)) - sz += (int) sizeof(unsigned); + sz += (int) sizeof (unsigned); if (OLONG(otmp)) - sz += (int) sizeof(long); + sz += (int) sizeof (long); if (OMAILCMD(otmp)) sz += (int) strlen(OMAILCMD(otmp)) + 1; } -- 2.40.0