Remove client production constraint on isAdmin

This commit is contained in:
AconiteGodOfSWG
2020-11-18 18:06:38 -05:00
parent 9261fb9952
commit 4a4b652e6e
4 changed files with 1 additions and 15 deletions

View File

@@ -54,9 +54,7 @@
#include "swgSharedUtility/JediConstants.h"
#if PRODUCTION == 0
bool PlayerObject::s_admin = false;
#endif
namespace PlayerObjectNamespace
{
@@ -2071,11 +2069,7 @@ void PlayerObject::getObjectInfo(std::map<std::string, std::map<std::string, Uni
void PlayerObject::setAdmin(bool admin)
{
#if PRODUCTION == 0
s_admin = admin;
#else
UNREF(admin);
#endif
}
//----------------------------------------------------------------------

View File

@@ -414,9 +414,7 @@ private:
private:
#if PRODUCTION == 0
static bool s_admin;
#endif
void shouldShowBackpack(bool show);
void shouldShowHelmet(bool show);
@@ -933,11 +931,7 @@ inline std::string const & PlayerObject::getDefaultAttackOverride() const
inline bool PlayerObject::isAdmin()
{
#if PRODUCTION == 0
return s_admin;
#else
return false;
#endif
}
// ----------------------------------------------------------------------

View File

@@ -1742,7 +1742,7 @@ bool CuiPreferences::getDragOntoContainers ()
bool CuiPreferences::getAllowTargetAnything ()
{
return ms_allowTargetAnything;
return ms_allowTargetAnything && PlayerObject::isAdmin();
}
//----------------------------------------------------------------------

View File

@@ -198,11 +198,9 @@ namespace SwgCuiHudNamespace
const ClientObject * const clientObject = obj ? obj->asClientObject () : 0;
#if PRODUCTION == 0
const bool allowTargetAnything = CuiPreferences::getAllowTargetAnything ();
//-- don't target buildings and shit
if (!allowTargetAnything)
#endif
{
//-- we are looking at an untargettable object
if (!clientObject)