splitobj() panic feedback

In case the splitobj() panic gets triggered again, provide some more
info about why that has happened.
This commit is contained in:
PatR
2025-04-20 14:31:33 -07:00
parent e21a5c6ac3
commit f9af1aa0cf

View File

@@ -458,8 +458,11 @@ splitobj(struct obj *obj, long num)
{
struct obj *otmp;
/* can't split containers */
if (obj->cobj || num <= 0L || obj->quan <= num)
panic("splitobj"); /* can't split containers */
panic("splitobj [cobj=%s num=%ld quan=%ld]",
obj->cobj ? "non-empty container" : "(null)", num, obj->quan);
otmp = newobj();
*otmp = *obj; /* copies whole structure */
otmp->oextra = (struct oextra *) 0;