From 22e8051ed8a2c214ea5c75b97efa22620fd2e8c1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 5 Nov 2011 01:43:07 +0300 Subject: Dont allow player to ignore self. --- src/playerrelations.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2