From: Rick L Bird Date: Sun, 15 May 2011 20:20:41 +0000 (-0400) Subject: PennMUSH 1.8.3p12 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=ae3d33e7de42ed84aa04eec7c8fdcd5ff09be0d0;p=cobramush.git PennMUSH 1.8.3p12 Author: captdeaf@gmail.com Date: Thu Jan 28 08:18:56 2010 +0000 Fixing a startup crashbug caused by match changes. Reordering match_player so it's not always done, only when MAT_PLAYER is set. This caused "*UNLOCKED*" to look up a player during startup, when lookup_player table was uninitialized. Refs #172 --- diff --git a/src/match.c b/src/match.c index a41f52e..be8db03 100644 --- a/src/match.c +++ b/src/match.c @@ -309,7 +309,6 @@ match_result(dbref who, const char *xname, int type, long flags) { dbref match, loc; dbref bestmatch = NOTHING; - dbref abs = parse_objid(xname); int curr = 0, final = 0, nocontrol = 0, exact = 0, done = 0; int goodwho = GoodObject(who); char *name, *sname; @@ -335,8 +334,9 @@ match_result(dbref who, const char *xname, int type, long flags) } /* match *, or */ - match = match_player(who, xname); - if (((flags & MAT_PMATCH) || ((flags & MAT_PLAYER) && *xname == LOOKUP_TOKEN)) && MATCH_TYPE) { + if (((flags & MAT_PMATCH) || + ((flags & MAT_PLAYER) && *xname == LOOKUP_TOKEN)) && MATCH_TYPE) { + match = match_player(who, xname); if (GoodObject(match)) { if (MATCH_CONTROLS) { return match; @@ -349,14 +349,16 @@ match_result(dbref who, const char *xname, int type, long flags) } /* dbref match */ - match = abs; - if (GoodObject(match) && MATCH_TYPE) { - if (!(flags & MAT_NEAR) || Long_Fingers(who) || (nearby(who, match) || controls(who, match))) { - /* valid dbref match */ - if (MATCH_CONTROLS) { - return match; - } else { - nocontrol = 1; + if (MATCH_TYPE) { + match = parse_objid(xname); + if (GoodObject(match)) { + if (!(flags & MAT_NEAR) || Long_Fingers(who) || (nearby(who, match) || controls(who, match))) { + /* valid dbref match */ + if (MATCH_CONTROLS) { + return match; + } else { + nocontrol = 1; + } } } }