… | |
… | |
1535 | if (victim->type == PLAYER && EXIT_PATH (trap)) |
1535 | if (victim->type == PLAYER && EXIT_PATH (trap)) |
1536 | { |
1536 | { |
1537 | /* Basically, don't show exits leading to random maps the |
1537 | /* Basically, don't show exits leading to random maps the |
1538 | * players output. |
1538 | * players output. |
1539 | */ |
1539 | */ |
1540 | if (trap->msg && strncmp (EXIT_PATH (trap), "/!", 2)) |
1540 | if (trap->msg && !EXIT_PATH (trap).starts_with ("/!")) |
1541 | victim->statusmsg (trap->msg, NDI_NAVY); |
1541 | victim->statusmsg (trap->msg, NDI_NAVY); |
1542 | |
1542 | |
1543 | trap->play_sound (trap->sound); |
1543 | trap->play_sound (trap->sound); |
1544 | victim->enter_exit (trap); |
1544 | victim->enter_exit (trap); |
1545 | } |
1545 | } |
… | |
… | |
2416 | if (!EXIT_PATH (tmp) || !is_legal_2ways_exit (op, tmp)) |
2416 | if (!EXIT_PATH (tmp) || !is_legal_2ways_exit (op, tmp)) |
2417 | op->failmsg (format ("The %s is closed.", query_name (tmp))); |
2417 | op->failmsg (format ("The %s is closed.", query_name (tmp))); |
2418 | else |
2418 | else |
2419 | { |
2419 | { |
2420 | /* Don't display messages for random maps. */ |
2420 | /* Don't display messages for random maps. */ |
2421 | if (tmp->msg && strncmp (EXIT_PATH (tmp), "/!", 2)) |
2421 | if (tmp->msg && !EXIT_PATH (tmp).starts_with ("/!")) |
2422 | op->statusmsg (tmp->msg, NDI_NAVY); |
2422 | op->statusmsg (tmp->msg, NDI_NAVY); |
2423 | |
2423 | |
2424 | op->enter_exit (tmp); |
2424 | op->enter_exit (tmp); |
2425 | } |
2425 | } |
2426 | |
2426 | |
… | |
… | |
3219 | return 1; |
3219 | return 1; |
3220 | } |
3220 | } |
3221 | |
3221 | |
3222 | //TODO: this obviously fails for players using a shorter prefix |
3222 | //TODO: this obviously fails for players using a shorter prefix |
3223 | // i.e. "R" can use Ragnarok's sword. |
3223 | // i.e. "R" can use Ragnarok's sword. |
3224 | if (op->level && (strncmp (op->name, who->name, strlen (who->name)))) |
3224 | if (op->level && !op->name.starts_with (who->name)) |
3225 | { |
3225 | { |
3226 | /* if the weapon does not have the name as the character, can't use it. */ |
3226 | /* if the weapon does not have the name as the character, can't use it. */ |
3227 | /* (Ragnarok's sword attempted to be used by Foo: won't work) */ |
3227 | /* (Ragnarok's sword attempted to be used by Foo: won't work) */ |
3228 | who->failmsg ("The weapon does not recognize you as its owner. H<Its name indicates that it belongs to somebody else.>"); |
3228 | who->failmsg ("The weapon does not recognize you as its owner. H<Its name indicates that it belongs to somebody else.>"); |
3229 | |
3229 | |
… | |
… | |
3402 | insert_ob_in_ob (tmp, who); |
3402 | insert_ob_in_ob (tmp, who); |
3403 | |
3403 | |
3404 | return 1; |
3404 | return 1; |
3405 | } |
3405 | } |
3406 | |
3406 | |
3407 | if (op->level && (strncmp (op->name, who->name, strlen (who->name)))) |
3407 | if (op->level && !op->name.starts_with (who->name)) |
3408 | { |
3408 | { |
3409 | who->failmsg ("The weapon does not recognize you as its owner. " |
3409 | who->failmsg ("The weapon does not recognize you as its owner. " |
3410 | "H<Its name indicates that it belongs to somebody else.>"); |
3410 | "H<Its name indicates that it belongs to somebody else.>"); |
3411 | if (tmp) |
3411 | if (tmp) |
3412 | insert_ob_in_ob (tmp, who); |
3412 | insert_ob_in_ob (tmp, who); |