mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-30 12:55:16 +01:00
tidy up pk_allowed
This commit is contained in:
parent
b81a73561a
commit
cb1606cd8a
1 changed files with 9 additions and 13 deletions
22
src/fight.c
22
src/fight.c
|
|
@ -127,24 +127,20 @@ void check_killer(struct char_data *ch, struct char_data *vict)
|
|||
|
||||
bool pk_allowed(struct char_data *ch, struct char_data *victim)
|
||||
{
|
||||
if (IS_NPC(ch) || IS_NPC(victim))
|
||||
return true; // NPCs not restricted
|
||||
/* NPCs are never restricted */
|
||||
if (IS_NPC(ch) || IS_NPC(victim))
|
||||
return true;
|
||||
|
||||
switch (CONFIG_PK_SETTING) {
|
||||
case CONFIG_PK_OFF:
|
||||
return false;
|
||||
if (CONFIG_PK_SETTING == CONFIG_PK_OFF)
|
||||
return false;
|
||||
|
||||
case CONFIG_PK_FREEFORALL:
|
||||
return true;
|
||||
if (CONFIG_PK_SETTING == CONFIG_PK_LIMITED)
|
||||
check_killer(ch, victim);
|
||||
|
||||
case CONFIG_PK_LIMITED:
|
||||
check_killer(ch, victim);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* start one char fighting another (yes, it is horrible, I know... ) */
|
||||
void set_fighting(struct char_data *ch, struct char_data *vict)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue