Fix duplication and clang warning in unreachable gathering target fix 30dcd696eb
/ D2120
The function was put in an anonymous namespace to avoid linking errors should another one be defined elsewhere. Reviewed By: elexis Differential Revision: https://code.wildfiregames.com/D2243 This was SVN commit r22825.
This commit is contained in:
parent
705266ceb2
commit
67795d4451
@ -21,28 +21,27 @@
|
||||
|
||||
#include "simulation2/system/InterfaceScripted.h"
|
||||
|
||||
std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player) const
|
||||
namespace {
|
||||
std::string VisibilityToString(ICmpRangeManager::ELosVisibility visibility)
|
||||
{
|
||||
ELosVisibility visibility = GetLosVisibility(ent, player);
|
||||
switch (visibility)
|
||||
{
|
||||
case VIS_HIDDEN: return "hidden";
|
||||
case VIS_FOGGED: return "fogged";
|
||||
case VIS_VISIBLE: return "visible";
|
||||
case ICmpRangeManager::VIS_HIDDEN: return "hidden";
|
||||
case ICmpRangeManager::VIS_FOGGED: return "fogged";
|
||||
case ICmpRangeManager::VIS_VISIBLE: return "visible";
|
||||
default: return "error"; // should never happen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player) const
|
||||
{
|
||||
return VisibilityToString(GetLosVisibility(ent, player));
|
||||
}
|
||||
|
||||
std::string ICmpRangeManager::GetLosVisibilityPosition_wrapper(entity_pos_t x, entity_pos_t z, int player) const
|
||||
{
|
||||
ELosVisibility visibility = GetLosVisibilityPosition(x, z, player);
|
||||
switch (visibility)
|
||||
{
|
||||
case VIS_HIDDEN: return "hidden";
|
||||
case VIS_FOGGED: return "fogged";
|
||||
case VIS_VISIBLE: return "visible";
|
||||
default: return "error"; // should never happen
|
||||
}
|
||||
return VisibilityToString(GetLosVisibilityPosition(x, z, player));
|
||||
}
|
||||
|
||||
BEGIN_INTERFACE_WRAPPER(RangeManager)
|
||||
|
@ -351,7 +351,6 @@ public:
|
||||
*/
|
||||
virtual ELosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const = 0;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Request the update of the visibility cache of ent at next turn.
|
||||
* Typically used for fogging.
|
||||
|
Loading…
Reference in New Issue
Block a user