diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-11-05 01:43:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-11-05 01:43:07 +0300 |
commit | 22e8051ed8a2c214ea5c75b97efa22620fd2e8c1 (patch) | |
tree | c2b61cf13586a7fbd3e673925fbae824a57c4f3b | |
parent | 6c4c6ca877c336e17c0378131a0a139792012a99 (diff) | |
download | mv-22e8051ed8a2c214ea5c75b97efa22620fd2e8c1.tar.gz mv-22e8051ed8a2c214ea5c75b97efa22620fd2e8c1.tar.bz2 mv-22e8051ed8a2c214ea5c75b97efa22620fd2e8c1.tar.xz mv-22e8051ed8a2c214ea5c75b97efa22620fd2e8c1.zip |
Dont allow player to ignore self.
-rw-r--r-- | src/playerrelations.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 1778da0c3..8facfdefb 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -28,6 +28,7 @@ #include "being.h" #include "configuration.h" #include "graphics.h" +#include "localplayer.h" #include "utils/dtor.h" #include "utils/gettext.h" @@ -327,6 +328,12 @@ bool PlayerRelationsManager::hasPermission(const std::string &name, void PlayerRelationsManager::setRelation(const std::string &player_name, PlayerRelation::Relation relation) { + if (!player_node || (relation != PlayerRelation::NEUTRAL + && player_node->getName() == player_name)) + { + return; + } + PlayerRelation *r = mRelations[player_name]; if (!r) mRelations[player_name] = new PlayerRelation(relation); |