X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fitem_key.qc;h=59cd9129af298650b354f461449772650435facb;hb=67b0ed3729e3e9245067180fc2f672a7f51b65b8;hp=1b423f5020f5646312a3c0b8d7a14380bb073344;hpb=8a390ed02bde47c98a5e6bd47c7eb9b1cb3cd1dc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index 1b423f502..59cd9129a 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -19,7 +19,7 @@ float item_keys_usekey(entity l, entity p) { return TRUE; } else { // only some of the needed keys were given - l.itemkeys &~= valid; + l.itemkeys &= ~valid; return TRUE; } } @@ -63,7 +63,7 @@ item_key * Key touch handler. */ void item_key_touch(void) { - if (other.classname != "player") + if not(IS_PLAYER(other)) return; // player already picked up this key @@ -73,7 +73,7 @@ void item_key_touch(void) { other.itemkeys |= self.itemkeys; play2(other, self.noise); - centerprint(other, self.message); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_TRIGGER, self.message); }; /** @@ -318,7 +318,7 @@ void trigger_keylock_touch(void) { started_delay = FALSE; // only player may trigger the lock - if (other.classname != "player") + if not(IS_PLAYER(other)) return; @@ -333,12 +333,12 @@ void trigger_keylock_touch(void) { if (key_used) { // one or more keys were given, but others are still missing! play2(other, self.noise1); - centerprint(other, strcat("You also need ", item_keys_keylist(self.itemkeys), "!")); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_ALSONEED, item_keys_keylist(self.itemkeys)); other.key_door_messagetime = time + 2; } else if (other.key_door_messagetime <= time) { // no keys were given play2(other, self.noise2); - centerprint(other, strcat("You need ", item_keys_keylist(self.itemkeys), "!")); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_DOOR_LOCKED_NEED, item_keys_keylist(self.itemkeys)); other.key_door_messagetime = time + 2; } @@ -352,7 +352,7 @@ void trigger_keylock_touch(void) { } else { // all keys were given! play2(other, self.noise); - centerprint(other, self.message); + Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_TRIGGER, self.message); if (self.target) trigger_keylock_trigger(self.target);