shithub: sce

Download patch

ref: 47b5c8421d974ddc96a6e38187913d5a53699800
parent: 0c7e24a984dce5b27035fb0162b86937e13f781f
author: qwx <qwx@sciops.net>
date: Sun Aug 15 20:25:50 EDT 2021

M ./com.c
M ./sim.spawn.c
more %M printing

--- a/com.c
+++ b/com.c
@@ -66,8 +66,8 @@
 	if((mo = derefmobj(r->idx, r->uuid)) == nil)
 		return nil;
 	if(mo->x != r->x || mo->y != r->y){
-		werrstr("phase error: req mobj at %d,%d, found %s at %d,%d",
-			r->x, r->y, mo->o->name, mo->x, mo->y);
+		werrstr("phase error: req mobj at %d,%d, found %M",
+			r->x, r->y, mo);
 		return nil;
 	}
 	return mo;
@@ -88,7 +88,7 @@
 	if((mo = mobjfromreq(&reqm)) == nil)
 		return -1;
 	if((mo->o->f & Fimmutable) || mo->o->speed == 0.0){
-		werrstr("reqmovenear: object %s can't move", mo->o->name);
+		werrstr("reqmovenear: object %M can't move", mo);
 		return -1;
 	}
 	if((tgt = mobjfromreq(&reqt)) == nil)
@@ -117,7 +117,7 @@
 	if((mo = mobjfromreq(&reqm)) == nil)
 		return -1;
 	if((mo->o->f & Fimmutable) || mo->o->speed == 0.0){
-		werrstr("reqmove: object %s can't move", mo->o->name);
+		werrstr("reqmove: object %M can't move", mo);
 		return -1;
 	}
 	if(tgt.x >= nodemapwidth || tgt.y >= nodemapheight){
@@ -171,12 +171,12 @@
 		case Tmovenear: fn = reqmovenear; break;
 		case Teom:
 			if(p < e)
-				dprint("parsemsg: trailing data\n");
+				fprint(2, "parsemsg: trailing data\n");
 			return 0;
-		default: dprint("parsemsg: invalid message type %ux\n", type); return -1;
+		default: fprint(2, "parsemsg: invalid message type %ux\n", type); return -1;
 		}
 		if((n = fn(p, e)) < 0)
-			dprint("parsemsg: %r\n");
+			fprint(2, "parsemsg: %r\n");
 		else
 			p += n;
 	}
--- a/sim.spawn.c
+++ b/sim.spawn.c
@@ -23,8 +23,8 @@
 		return nil;
 	}
 	if(mo->idx != idx || mo->uuid != uuid){
-		werrstr("phase error: %#ux,%ld → %s %#ux,%ld",
-			idx, uuid, mo->o->name, mo->idx, mo->uuid);
+		werrstr("phase error: %#ux,%ld ≠ %M %#ux,%ld",
+			idx, uuid, mo, mo->idx, mo->uuid);
 		return nil;
 	}
 	return mo;