allow filtering sides on controller=

Disabled for networked multiplayer since the value differs between clients.
This commit is contained in:
anonymissimus 2013-04-30 16:01:30 +02:00
parent 4aba43d15d
commit 3f2f24d45b

View file

@ -23,6 +23,7 @@
#include "variable.hpp"
#include "team.hpp"
#include "serialization/string_utils.hpp"
#include "network.hpp"
#include <boost/foreach.hpp>
@ -172,6 +173,19 @@ bool side_filter::match_internal(const team &t) const
}
}
const config::attribute_value cfg_controller = cfg_["controller"];
if (!cfg_controller.blank())
{
if (network::nconnections() > 0)
ERR_NG << "ignoring controller= in SSF due to danger of OOS errors\n";
else
{
const std::string& controller = cfg_controller;
if(strcmp(controller.c_str(), t.controller_string()) != 0)
return false;
}
}
return true;
}