| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
#include "config.h" |
|---|
| 55 |
|
|---|
| 56 |
#include <ctype.h> |
|---|
| 57 |
#include <limits.h> |
|---|
| 58 |
#include <stdlib.h> |
|---|
| 59 |
#include <string.h> |
|---|
| 60 |
|
|---|
| 61 |
#include "copyrite.h" |
|---|
| 62 |
#include "conf.h" |
|---|
| 63 |
#include "mushdb.h" |
|---|
| 64 |
#include "match.h" |
|---|
| 65 |
#include "externs.h" |
|---|
| 66 |
#include "log.h" |
|---|
| 67 |
#include "game.h" |
|---|
| 68 |
#include "extmail.h" |
|---|
| 69 |
#include "malias.h" |
|---|
| 70 |
#include "attrib.h" |
|---|
| 71 |
#include "dbdefs.h" |
|---|
| 72 |
#include "flags.h" |
|---|
| 73 |
#include "lock.h" |
|---|
| 74 |
#include "confmagic.h" |
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
dbref first_free = NOTHING; |
|---|
| 79 |
|
|---|
| 80 |
static dbref what_to_destroy(dbref player, char *name, int confirm); |
|---|
| 81 |
static void pre_destroy(dbref player, dbref thing); |
|---|
| 82 |
static void free_object(dbref thing); |
|---|
| 83 |
static void empty_contents(dbref thing); |
|---|
| 84 |
static void clear_thing(dbref thing); |
|---|
| 85 |
static void clear_player(dbref thing); |
|---|
| 86 |
static void clear_room(dbref thing); |
|---|
| 87 |
static void clear_exit(dbref thing); |
|---|
| 88 |
|
|---|
| 89 |
static void check_fields(void); |
|---|
| 90 |
static void check_connected_rooms(void); |
|---|
| 91 |
static void mark_connected(dbref loc); |
|---|
| 92 |
static void check_connected_marks(void); |
|---|
| 93 |
static void mark_contents(dbref loc); |
|---|
| 94 |
static void check_contents(void); |
|---|
| 95 |
static void check_locations(void); |
|---|
| 96 |
static void check_zones(void); |
|---|
| 97 |
static int attribute_owner_helper |
|---|
| 98 |
(dbref player, dbref thing, dbref parent, char const *pattern, ATTR *atr, |
|---|
| 99 |
void *args); |
|---|
| 100 |
|
|---|
| 101 |
extern void remove_all_obj_chan(dbref thing); |
|---|
| 102 |
extern void chan_chownall(dbref old, dbref new); |
|---|
| 103 |
|
|---|
| 104 |
extern struct db_stat_info current_state; |
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
#define SetMarked(x) Type(x) |= TYPE_MARKED |
|---|
| 108 |
|
|---|
| 109 |
#define ClearMarked(x) Type(x) &= ~TYPE_MARKED |
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
static dbref |
|---|
| 207 |
what_to_destroy(dbref player, char *name, int confirm) |
|---|
| 208 |
{ |
|---|
| 209 |
dbref thing; |
|---|
| 210 |
|
|---|
| 211 |
thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING); |
|---|
| 212 |
if (thing == NOTHING) |
|---|
| 213 |
return NOTHING; |
|---|
| 214 |
|
|---|
| 215 |
if (IsGarbage(thing)) { |
|---|
| 216 |
notify(player, T("Destroying that again is hardly necessary.")); |
|---|
| 217 |
return NOTHING; |
|---|
| 218 |
} |
|---|
| 219 |
if (God(thing)) { |
|---|
| 220 |
notify(player, T("Destroying God would be blasphemous.")); |
|---|
| 221 |
return NOTHING; |
|---|
| 222 |
} |
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
if (!controls(player, thing) && |
|---|
| 229 |
!(IsExit(thing) && |
|---|
| 230 |
(controls(player, Destination(thing)) || |
|---|
| 231 |
controls(player, Source(thing)))) && |
|---|
| 232 |
!(DestOk(thing) && eval_lock(player, thing, Destroy_Lock))) { |
|---|
| 233 |
notify(player, T("Permission denied.")); |
|---|
| 234 |
return NOTHING; |
|---|
| 235 |
} |
|---|
| 236 |
if (thing == PLAYER_START || thing == MASTER_ROOM || thing == BASE_ROOM || |
|---|
| 237 |
thing == DEFAULT_HOME || God(thing)) { |
|---|
| 238 |
notify(player, T("That is too special to be destroyed.")); |
|---|
| 239 |
return NOTHING; |
|---|
| 240 |
} |
|---|
| 241 |
if (REALLY_SAFE) { |
|---|
| 242 |
if (Safe(thing) && !DestOk(thing)) { |
|---|
| 243 |
notify(player, |
|---|
| 244 |
T |
|---|
| 245 |
("That object is set SAFE. You must set it !SAFE before destroying it.")); |
|---|
| 246 |
return NOTHING; |
|---|
| 247 |
} |
|---|
| 248 |
} else { |
|---|
| 249 |
if (Safe(thing) && !DestOk(thing) && !confirm) { |
|---|
| 250 |
notify(player, T("That object is marked SAFE. Use @nuke to destroy it.")); |
|---|
| 251 |
return NOTHING; |
|---|
| 252 |
} |
|---|
| 253 |
} |
|---|
| 254 |
|
|---|
| 255 |
if (!confirm && !Owns(player, thing) && !DestOk(thing)) { |
|---|
| 256 |
notify(player, |
|---|
| 257 |
T("That object does not belong to you. Use @nuke to destroy it.")); |
|---|
| 258 |
return NOTHING; |
|---|
| 259 |
} |
|---|
| 260 |
|
|---|
| 261 |
switch (Typeof(thing)) { |
|---|
| 262 |
case TYPE_PLAYER: |
|---|
| 263 |
if (!IsPlayer(player)) { |
|---|
| 264 |
notify(player, T("Programs don't kill people; people kill people!")); |
|---|
| 265 |
return NOTHING; |
|---|
| 266 |
} |
|---|
| 267 |
|
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 |
|
|---|
| 272 |
if (!Wizard(player)) { |
|---|
| 273 |
notify(player, T("Sorry, no suicide allowed.")); |
|---|
| 274 |
return NOTHING; |
|---|
| 275 |
} |
|---|
| 276 |
|
|---|
| 277 |
if (Wizard(thing) && !God(player)) { |
|---|
| 278 |
notify(player, T("Even you can't do that!")); |
|---|
| 279 |
return NOTHING; |
|---|
| 280 |
} |
|---|
| 281 |
if (Connected(thing)) { |
|---|
| 282 |
notify(player, |
|---|
| 283 |
T("How gruesome. You may not destroy players who are connected.")); |
|---|
| 284 |
return NOTHING; |
|---|
| 285 |
} |
|---|
| 286 |
if (!confirm) { |
|---|
| 287 |
notify(player, T("You must use @nuke to destroy a player.")); |
|---|
| 288 |
return NOTHING; |
|---|
| 289 |
} |
|---|
| 290 |
break; |
|---|
| 291 |
case TYPE_THING: |
|---|
| 292 |
if (!confirm && Wizard(thing)) { |
|---|
| 293 |
notify(player, |
|---|
| 294 |
T("That object is set WIZARD. You must use @nuke to destroy it.")); |
|---|
| 295 |
return NOTHING; |
|---|
| 296 |
} |
|---|
| 297 |
break; |
|---|
| 298 |
case TYPE_ROOM: |
|---|
| 299 |
break; |
|---|
| 300 |
case TYPE_EXIT: |
|---|
| 301 |
break; |
|---|
| 302 |
} |
|---|
| 303 |
return thing; |
|---|
| 304 |
|
|---|
| 305 |
} |
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
void |
|---|
| 317 |
do_destroy(dbref player, char *name, int confirm) |
|---|
| 318 |
{ |
|---|
| 319 |
dbref thing; |
|---|
| 320 |
thing = what_to_destroy(player, name, confirm); |
|---|
| 321 |
if (!GoodObject(thing)) |
|---|
| 322 |
return; |
|---|
| 323 |
|
|---|
| 324 |
|
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 |
if (Going(thing)) { |
|---|
| 328 |
free_object(thing); |
|---|
| 329 |
notify(player, T("Destroyed.")); |
|---|
| 330 |
return; |
|---|
| 331 |
} |
|---|
| 332 |
|
|---|
| 333 |
if (!REALLY_SAFE && Safe(thing)) |
|---|
| 334 |
notify(player, |
|---|
| 335 |
T |
|---|
| 336 |
("Warning: Target is set SAFE, but scheduling for destruction anyway.")); |
|---|
| 337 |
switch (Typeof(thing)) { |
|---|
| 338 |
case TYPE_ROOM: |
|---|
| 339 |
|
|---|
| 340 |
notify_except(Contents(thing), NOTHING, |
|---|
| 341 |
T("The room shakes and begins to crumble."), 0); |
|---|
| 342 |
if (Owns(player, thing)) |
|---|
| 343 |
notify_format(player, |
|---|
| 344 |
T("You will be rewarded shortly for %s."), |
|---|
| 345 |
object_header(player, thing)); |
|---|
| 346 |
else { |
|---|
| 347 |
notify_format(player, |
|---|
| 348 |
T |
|---|
| 349 |
("The wrecking ball is on its way for %s's %s and its exits."), |
|---|
| 350 |
Name(Owner(thing)), object_header(player, thing)); |
|---|
| 351 |
notify_format(Owner(thing), |
|---|
| 352 |
T("%s has scheduled your room %s to be destroyed."), |
|---|
| 353 |
Name(player), object_header(Owner(thing), thing)); |
|---|
| 354 |
} |
|---|
| 355 |
break; |
|---|
| 356 |
case TYPE_PLAYER: |
|---|
| 357 |
|
|---|
| 358 |
notify_format(player, |
|---|
| 359 |
(DESTROY_POSSESSIONS ? |
|---|
| 360 |
(REALLY_SAFE ? |
|---|
| 361 |
T |
|---|
| 362 |
("%s and all their (non-SAFE) objects are scheduled to be destroyed.") |
|---|
| 363 |
: |
|---|
| 364 |
T |
|---|
| 365 |
("%s and all their objects are scheduled to be destroyed.")) |
|---|
| 366 |
: T("%s is scheduled to be destroyed.")), |
|---|
| 367 |
object_header(player, thing)); |
|---|
| 368 |
break; |
|---|
| 369 |
case TYPE_THING: |
|---|
| 370 |
if (!Owns(player, thing)) { |
|---|
| 371 |
notify_format(player, T("%s's %s is scheduled to be destroyed."), |
|---|
| 372 |
Name(Owner(thing)), object_header(player, thing)); |
|---|
| 373 |
if (!DestOk(thing)) |
|---|
| 374 |
notify_format(Owner(thing), |
|---|
| 375 |
T("%s has scheduled your %s for destruction."), |
|---|
| 376 |
Name(player), object_header(Owner(thing), thing)); |
|---|
| 377 |
} else { |
|---|
| 378 |
notify_format(player, T("%s is scheduled to be destroyed."), |
|---|
| 379 |
object_header(player, thing)); |
|---|
| 380 |
} |
|---|
| 381 |
break; |
|---|
| 382 |
case TYPE_EXIT: |
|---|
| 383 |
if (!Owns(player, thing)) { |
|---|
| 384 |
notify_format(Owner(thing), |
|---|
| 385 |
T("%s has scheduled your %s for destruction."), |
|---|
| 386 |
Name(player), object_header(Owner(thing), thing)); |
|---|
| 387 |
notify_format(player, |
|---|
| 388 |
T("%s's %s is scheduled to be destroyed."), |
|---|
| 389 |
Name(Owner(thing)), object_header(player, thing)); |
|---|
| 390 |
} else |
|---|
| 391 |
notify_format(player, |
|---|
| 392 |
T("%s is scheduled to be destroyed."), |
|---|
| 393 |
object_header(player, thing)); |
|---|
| 394 |
break; |
|---|
| 395 |
default: |
|---|
| 396 |
do_log(LT_ERR, NOTHING, NOTHING, T("Surprising type in do_destroy.")); |
|---|
| 397 |
return; |
|---|
| 398 |
} |
|---|
| 399 |
|
|---|
| 400 |
pre_destroy(player, thing); |
|---|
| 401 |
return; |
|---|
| 402 |
} |
|---|
| 403 |
|
|---|
| 404 |
|
|---|
| 405 |
|
|---|
| 406 |
|
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 |
|
|---|
| 411 |
|
|---|
| 412 |
|
|---|
| 413 |
|
|---|
| 414 |
void |
|---|
| 415 |
do_undestroy(dbref player, char *name) |
|---|
| 416 |
{ |
|---|
| 417 |
dbref thing; |
|---|
| 418 |
thing = noisy_match_result(player, name, NOTYPE, MAT_EVERYTHING); |
|---|
| 419 |
if (!GoodObject(thing)) { |
|---|
| 420 |
return; |
|---|
| 421 |
} |
|---|
| 422 |
if (!controls(player, thing)) { |
|---|
| 423 |
notify(player, T("Alas, your efforts of mercy are in vain.")); |
|---|
| 424 |
return; |
|---|
| 425 |
} |
|---|
| 426 |
if (undestroy(player, thing)) { |
|---|
| 427 |
notify_format(Owner(thing), |
|---|
| 428 |
T("Your %s has been spared from destruction."), |
|---|
| 429 |
object_header(Owner(thing), thing)); |
|---|
| 430 |
if (player != Owner(thing)) { |
|---|
| 431 |
notify_format(player, |
|---|
| 432 |
T("%s's %s has been spared from destruction."), |
|---|
| 433 |
Name(Owner(thing)), object_header(player, thing)); |
|---|
| 434 |
} |
|---|
| 435 |
} else { |
|---|
| 436 |
notify(player, T("That can't be undestroyed.")); |
|---|
| 437 |
} |
|---|
| 438 |
} |
|---|
| 439 |
|
|---|
| 440 |
|
|---|
| 441 |
|
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 |
static void |
|---|
| 448 |
pre_destroy(dbref player, dbref thing) |
|---|
| 449 |
{ |
|---|
| 450 |
dbref tmp; |
|---|
| 451 |
if (Going(thing) || IsGarbage(thing)) { |
|---|
| 452 |
|
|---|
| 453 |
return; |
|---|
| 454 |
} |
|---|
| 455 |
set_flag_internal(thing, "GOING"); |
|---|
| 456 |
clear_flag_internal(thing, "GOING_TWICE"); |
|---|
| 457 |
|
|---|
| 458 |
|
|---|
| 459 |
switch (Typeof(thing)) { |
|---|
| 460 |
case TYPE_ROOM: |
|---|
| 461 |
DOLIST(tmp, Exits(thing)) { |
|---|
| 462 |
pre_destroy(player, tmp); |
|---|
| 463 |
} |
|---|
| 464 |
break; |
|---|
| 465 |
case TYPE_PLAYER: |
|---|
| 466 |
if (DESTROY_POSSESSIONS) { |
|---|
| 467 |
for (tmp = 0; tmp < db_top; tmp++) { |
|---|
| 468 |
if (Owner(tmp) == thing && |
|---|
| 469 |
(tmp != thing) && (!REALLY_SAFE || !Safe(thing))) { |
|---|
| 470 |
pre_destroy(player, tmp); |
|---|
| 471 |
} |
|---|
| 472 |
} |
|---|
| 473 |
} |
|---|
| 474 |
break; |
|---|
| 475 |
case TYPE_THING: |
|---|
| 476 |
break; |
|---|
| 477 |
case TYPE_EXIT: |
|---|
| 478 |
|
|---|
| 479 |
|
|---|
| 480 |
if ((Owner(thing) != Owner(Source(thing))) && Going(Source(thing))) { |
|---|
| 481 |
if (!Owns(player, thing)) { |
|---|
| 482 |
notify_format(Owner(thing), |
|---|
| 483 |
T("%s has scheduled your %s for destruction."), |
|---|
| 484 |
Name(player), object_header(Owner(thing), thing)); |
|---|
| 485 |
} |
|---|
| 486 |
} |
|---|
| 487 |
break; |
|---|
| 488 |
default: |
|---|
| 489 |
do_log(LT_ERR, NOTHING, NOTHING, T("Surprising type in pre_destroy.")); |
|---|
| 490 |
return; |
|---|
| 491 |
} |
|---|
| 492 |
|
|---|
| 493 |
if (ADESTROY_ATTR) |
|---|
| 494 |
did_it(player, thing, NULL, NULL, NULL, NULL, "ADESTROY", NOTHING); |
|---|
| 495 |
|
|---|
| 496 |
return; |
|---|
| 497 |
|
|---|
| 498 |
} |
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
|
|---|
| 502 |
|
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
|
|---|
| 506 |
|
|---|
| 507 |
|
|---|
| 508 |
|
|---|
| 509 |
int |
|---|
| 510 |
undestroy(dbref player, dbref thing) |
|---|
| 511 |
{ |
|---|
| 512 |
dbref tmp; |
|---|
| 513 |
if (!Going(thing) || IsGarbage(thing)) { |
|---|
| 514 |
return 0; |
|---|
| 515 |
} |
|---|
| 516 |
clear_flag_internal(thing, "GOING"); |
|---|
| 517 |
clear_flag_internal(thing, "GOING_TWICE"); |
|---|
| 518 |
if (!Halted(thing)) |
|---|
| 519 |
(void) queue_attribute_noparent(thing, "STARTUP", thing); |
|---|
| 520 |
|
|---|
| 521 |
if (Going(Owner(thing))) { |
|---|
| 522 |
if (Owner(thing) != player) { |
|---|
| 523 |
notify_format(player, |
|---|
| 524 |
T("%s has been spared from destruction."), |
|---|
| 525 |
object_header(player, Owner(thing))); |
|---|
| 526 |
notify_format(Owner(thing), |
|---|
| 527 |
T("You have been spared from destruction by %s."), |
|---|
| 528 |
Name(player)); |
|---|
| 529 |
} else { |
|---|
| 530 |
notify(player, T("You have been spared from destruction.")); |
|---|
| 531 |
} |
|---|
| 532 |
(void) undestroy(player, Owner(thing)); |
|---|
| 533 |
} |
|---|
| 534 |
switch (Typeof(thing)) { |
|---|
| 535 |
case TYPE_PLAYER: |
|---|
| 536 |
if (DESTROY_POSSESSIONS) |
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
for (tmp = 0; tmp < db_top; tmp++) { |
|---|
| 542 |
if (Owns(thing, tmp) && |
|---|
| 543 |
(tmp != thing) && |
|---|
| 544 |
!(IsExit(tmp) && !Owns(thing, Source(tmp)) && Going(Source(tmp)))) { |
|---|
| 545 |
(void) undestroy(player, tmp); |
|---|
| 546 |
} |
|---|
| 547 |
} |
|---|
| 548 |
break; |
|---|
| 549 |
case TYPE_THING: |
|---|
| 550 |
break; |
|---|
| 551 |
case TYPE_EXIT: |
|---|
| 552 |
|
|---|
| 553 |
if (Going(Source(thing))) { |
|---|
| 554 |
(void) undestroy(player, Source(thing)); |
|---|
| 555 |
notify_format(player, |
|---|
| 556 |
T("The room %s has been spared from destruction."), |
|---|
| 557 |
object_header(player, Source(thing))); |
|---|
| 558 |
if (Owner(Source(thing)) != player) { |
|---|
| 559 |
notify_format(Owner(Source(thing)), |
|---|
| 560 |
T("The room %s has been spared from destruction by %s."), |
|---|
| 561 |
object_header(Owner(Source(thing)), Source(thing)), |
|---|
| 562 |
Name(player)); |
|---|
| 563 |
} |
|---|
| 564 |
} |
|---|
| 565 |
break; |
|---|
| 566 |
case TYPE_ROOM: |
|---|
| 567 |
|
|---|
| 568 |
|
|---|
| 569 |
|
|---|
| 570 |
DOLIST(tmp, Exits(thing)) { |
|---|
| 571 |
if (DESTROY_POSSESSIONS ? (!Going(Owner(tmp)) || Safe(tmp)) : 1) { |
|---|
| 572 |
(void) undestroy(player, tmp); |
|---|
| 573 |
} |
|---|
| 574 |
} |
|---|
| 575 |
break; |
|---|
| 576 |
default: |
|---|
| 577 |
do_log(LT_ERR, NOTHING, NOTHING, T("Surprising type in un_destroy.")); |
|---|
| 578 |
return 0; |
|---|
| 579 |
} |
|---|
| 580 |
return 1; |
|---|
| 581 |
} |
|---|
| 582 |
|
|---|
| 583 |
|
|---|
| 584 |
|
|---|
| 585 |
|
|---|
| 586 |
|
|---|
| 587 |
|
|---|
| 588 |
static void |
|---|
| 589 |
free_object(dbref thing) |
|---|
| 590 |
{ |
|---|
| 591 |
dbref i, loc; |
|---|
| 592 |
if (!GoodObject(thing)) |
|---|
| 593 |
|
|---|