--- deliantra/server/common/region.C 2006/12/11 19:46:46 1.8 +++ deliantra/server/common/region.C 2007/01/02 23:39:21 1.14 @@ -75,14 +75,16 @@ { region *reg; - if (m->region != NULL) + if (m->region) return m->region->name; + for (reg = first_region; reg != NULL; reg = reg->next) { if (reg->fallback) return reg->name; } - LOG (llevInfo, "map %s had no region and I couldn't find a fallback to use.\n", m->name); + + LOG (llevInfo, "map %s had no region and I couldn't find a fallback to use.\n", &m->name); return "unknown"; } @@ -236,7 +238,7 @@ { if (reg->jailmap) { - exit = get_object (); + exit = object::create (); EXIT_PATH (exit) = reg->jailmap; /* damned exits reset savebed and remove teleports, so the prisoner can't escape */ SET_FLAG (exit, FLAG_DAMNED); @@ -290,16 +292,7 @@ region * get_region_struct (void) { - - region *reg; - - reg = (region *) CALLOC (1, sizeof (region)); - if (reg == NULL) - fatal (OUT_OF_MEMORY); - - memset (reg, '\0', sizeof (region)); - - return reg; + return new region; } /* @@ -356,7 +349,7 @@ { *end = 0; newreg = get_region_struct (); - newreg->name = strdup_local (value); + newreg->name = strdup (value); } else if (!strcmp (key, "parent")) { @@ -366,12 +359,12 @@ * parsed. */ *end = 0; - newreg->parent_name = strdup_local (value); + newreg->parent_name = strdup (value); } else if (!strcmp (key, "longname")) { *end = 0; - newreg->longname = strdup_local (value); + newreg->longname = strdup (value); } else if (!strcmp (key, "jail")) { @@ -384,7 +377,7 @@ LOG (llevError, "region.c: malformated regions entry: jail %s\n", value); continue; } - newreg->jailmap = strdup_local (path); + newreg->jailmap = strdup (path); newreg->jailx = x; newreg->jaily = y; } @@ -406,7 +399,7 @@ * so better do it here too... */ if (msgpos != 0) - newreg->msg = strdup_local (msgbuf); + newreg->msg = strdup (msgbuf); /* we have to reset msgpos, or the next region will store both msg blocks. */ msgpos = 0; @@ -458,5 +451,5 @@ } region_count++; } - LOG (llevDebug, "Assigned %u regions with %u parents.", region_count, parent_count); + LOG (llevDebug, "Assigned %u regions with %u parents.\n", region_count, parent_count); }