mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-31 01:15:48 -04:00
Revert "Revert "newer standards prefer nullptr over NULL - this is most of them but there are others too""
This reverts commit 8e2160f33e.
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
// class GameScriptObject static members
|
||||
//========================================================================
|
||||
|
||||
GameScriptObject::ScriptDataMap * GameScriptObject::ms_scriptDataMap = NULL;
|
||||
GameScriptObject::ScriptDataMap * GameScriptObject::ms_scriptDataMap = nullptr;
|
||||
bool GameScriptObject::m_pauseScripting = false;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ bool GameScriptObject::m_pauseScripting = false;
|
||||
* Class constructor.
|
||||
*/
|
||||
GameScriptObject::GameScriptObject(void) :
|
||||
m_owner(NULL),
|
||||
m_owner(nullptr),
|
||||
m_scriptList(),
|
||||
m_scriptListInitialized(false),
|
||||
m_scriptListValid(false),
|
||||
@@ -69,11 +69,11 @@ GameScriptObject::~GameScriptObject()
|
||||
{
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("GameScriptObject::~GameScriptObject removeJavaId\n");
|
||||
if (JavaLibrary::instance() != NULL /*&& m_javaId != NULL*/)
|
||||
if (JavaLibrary::instance() != nullptr /*&& m_javaId != nullptr*/)
|
||||
{
|
||||
NOT_NULL(m_owner);
|
||||
JavaLibrary::removeJavaId(m_owner->getNetworkId());
|
||||
// m_javaId = NULL;
|
||||
// m_javaId = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ GameScriptObject::~GameScriptObject()
|
||||
removeAll();
|
||||
}
|
||||
m_scriptList.clear();
|
||||
m_owner = NULL;
|
||||
m_owner = nullptr;
|
||||
} // GameScriptObject::~GameScriptObject
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ GameScriptObject::~GameScriptObject()
|
||||
*/
|
||||
bool GameScriptObject::installScriptEngine(void)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("Trying to install script engine more than once"));
|
||||
return true;
|
||||
@@ -101,7 +101,7 @@ bool GameScriptObject::installScriptEngine(void)
|
||||
ms_scriptDataMap = new GameScriptObject::ScriptDataMap;
|
||||
Scripting::InitScriptFuncHashMap();
|
||||
JavaLibrary::install();
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return false;
|
||||
enableNewJediTracking(ConfigServerGame::getEnableNewJedi());
|
||||
return true;
|
||||
@@ -114,7 +114,7 @@ void GameScriptObject::removeScriptEngine(void)
|
||||
{
|
||||
JavaLibrary::remove();
|
||||
delete ms_scriptDataMap;
|
||||
ms_scriptDataMap = NULL;
|
||||
ms_scriptDataMap = nullptr;
|
||||
Scripting::RemoveScriptFuncHashMap();
|
||||
} // GameScriptObject::removeScriptEngine
|
||||
|
||||
@@ -145,10 +145,10 @@ void GameScriptObject::alter(real time)
|
||||
*/
|
||||
void GameScriptObject::setOwnerIsAuthoritative(bool authoritative, uint32 pid)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
if (m_owner != NULL && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
if (m_owner != nullptr && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
{
|
||||
JavaLibrary::instance()->setObjIdAuthoritative(m_owner->getNetworkId(), authoritative, pid);
|
||||
|
||||
@@ -171,9 +171,9 @@ void GameScriptObject::setOwnerIsAuthoritative(bool authoritative, uint32 pid)
|
||||
*/
|
||||
void GameScriptObject::setOwnerIsLoaded(void)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
if (m_owner != NULL && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
if (m_owner != nullptr && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
{
|
||||
JavaLibrary::instance()->setObjIdLoaded(m_owner->getNetworkId());
|
||||
}
|
||||
@@ -189,9 +189,9 @@ void GameScriptObject::setOwnerIsLoaded(void)
|
||||
*/
|
||||
void GameScriptObject::setOwnerIsInitialized(void)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
if (m_owner != NULL && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
if (m_owner != nullptr && m_owner->getNetworkId() != NetworkId::cms_invalid)
|
||||
{
|
||||
JavaLibrary::instance()->setObjIdInitialized(m_owner->getNetworkId());
|
||||
if (m_owner->isAuthoritative())
|
||||
@@ -211,10 +211,10 @@ void GameScriptObject::setOwnerIsInitialized(void)
|
||||
*/
|
||||
void GameScriptObject::setOwnerDestroyed(void)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
if (m_owner != NULL && m_owner->getNetworkId() != NetworkId::cms_invalid && m_owner->isAuthoritative())
|
||||
if (m_owner != nullptr && m_owner->getNetworkId() != NetworkId::cms_invalid && m_owner->isAuthoritative())
|
||||
JavaLibrary::flagDestroyed(m_owner->getNetworkId());
|
||||
|
||||
} //lint !e1762 Do not make const
|
||||
@@ -283,7 +283,7 @@ int GameScriptObject::attachScript(const std::string& scriptName, bool runTrigge
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ms_scriptDataMap == NULL || JavaLibrary::instance() == NULL)
|
||||
if (ms_scriptDataMap == nullptr || JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if (ms_scriptDataMap->find(scriptName) == ms_scriptDataMap->end())
|
||||
@@ -379,7 +379,7 @@ int GameScriptObject::detachScript(const std::string& scriptName)
|
||||
else
|
||||
{
|
||||
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
// Make sure to call the detach trigger on this one script if one exists.
|
||||
@@ -420,12 +420,12 @@ void GameScriptObject::initScriptInstances()
|
||||
{
|
||||
m_scriptListInitialized = true;
|
||||
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
if (!m_owner)
|
||||
{
|
||||
WARNING_STRICT_FATAL(true, ("Use of null m_owner in ::initScriptInstances()"));
|
||||
WARNING_STRICT_FATAL(true, ("Use of nullptr m_owner in ::initScriptInstances()"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ void GameScriptObject::initScriptInstances()
|
||||
*/
|
||||
void GameScriptObject::removeAll(void)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
// removeAll() cannot be overriden by scripts
|
||||
@@ -483,12 +483,12 @@ int GameScriptObject::trigAllScripts(Scripting::TrigId trigId, ScriptParams &par
|
||||
{
|
||||
NOT_NULL(m_owner);
|
||||
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
// if (m_javaId == NULL && m_owner != NULL && m_owner->getNetworkId().getValue() != 0)
|
||||
// if (m_javaId == nullptr && m_owner != nullptr && m_owner->getNetworkId().getValue() != 0)
|
||||
// {
|
||||
// if (JavaLibrary::instance() != NULL)
|
||||
// if (JavaLibrary::instance() != nullptr)
|
||||
// m_javaId = JavaLibrary::getObjId(m_owner->getNetworkId());
|
||||
// }
|
||||
|
||||
@@ -497,7 +497,7 @@ int GameScriptObject::trigAllScripts(Scripting::TrigId trigId, ScriptParams &par
|
||||
|
||||
//Authoritative check temporarily removed because some triggers aren't being called
|
||||
//because the setAuth message hasn't come in yet from Central on load.
|
||||
if (m_owner == NULL) //@todo FIX THIS HACK || !m_owner->isAuthoritative())
|
||||
if (m_owner == nullptr) //@todo FIX THIS HACK || !m_owner->isAuthoritative())
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if(!m_owner->isAuthoritative())
|
||||
@@ -506,7 +506,7 @@ int GameScriptObject::trigAllScripts(Scripting::TrigId trigId, ScriptParams &par
|
||||
Archive::put(paramArchive, params);
|
||||
MessageQueueScriptTrigger * data = new MessageQueueScriptTrigger(static_cast<int>(trigId), paramArchive);
|
||||
ServerController * controller = dynamic_cast<ServerController *>(m_owner->getController());
|
||||
if(controller != NULL)
|
||||
if(controller != nullptr)
|
||||
{
|
||||
controller->appendMessage(
|
||||
CM_scriptTrigger,
|
||||
@@ -557,13 +557,13 @@ int GameScriptObject::trigAllScripts(Scripting::TrigId trigId, ScriptParams &par
|
||||
*/
|
||||
int GameScriptObject::trigOneScript(const std::string& scriptName, Scripting::TrigId trigId, ScriptParams ¶ms) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if (m_pauseScripting)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if (m_owner == NULL /*|| !m_owner->isAuthoritative()*/)
|
||||
if (m_owner == nullptr /*|| !m_owner->isAuthoritative()*/)
|
||||
return SCRIPT_OVERRIDE;
|
||||
|
||||
if (!m_owner->isAuthoritative() && (trigId != Scripting::TRIG_ATTACH &&
|
||||
@@ -607,7 +607,7 @@ int GameScriptObject::trigOneScript(const std::string& scriptName, Scripting::Tr
|
||||
int GameScriptObject::trigScriptFromConsole(const Scripting::TrigId trigId,
|
||||
const std::string &scriptName, const StringVector_t &args) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
{
|
||||
LOG("ScriptInvestigation", ("Returning script continue from console trigger request because there is no JavaLibrary instance\n"));
|
||||
return SCRIPT_CONTINUE;
|
||||
@@ -619,9 +619,9 @@ int GameScriptObject::trigScriptFromConsole(const Scripting::TrigId trigId,
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
if (m_owner == NULL )
|
||||
if (m_owner == nullptr )
|
||||
{
|
||||
LOG("ScriptInvestigation", ("Returning script override from console trigger request becuase m_owner is null\n"));
|
||||
LOG("ScriptInvestigation", ("Returning script override from console trigger request becuase m_owner is nullptr\n"));
|
||||
return SCRIPT_OVERRIDE;
|
||||
}
|
||||
|
||||
@@ -660,14 +660,14 @@ int GameScriptObject::trigScriptFromConsole(const Scripting::TrigId trigId,
|
||||
bool GameScriptObject::handleMessage(const std::string &messageName,
|
||||
const ScriptDictionaryPtr & data)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
{
|
||||
WARNING_STRICT_FATAL(true, ("(messageToFailure) GameScriptObject::handleMessage got message "
|
||||
"when Java not running"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getOwner() == NULL)
|
||||
if (getOwner() == nullptr)
|
||||
{
|
||||
WARNING_STRICT_FATAL(true, ("(messageToFailure) GameScriptObject::handleMessage got message "
|
||||
"with no owner"));
|
||||
@@ -703,7 +703,7 @@ bool GameScriptObject::handleMessage(const std::string &messageName, const std::
|
||||
{
|
||||
ScriptDictionaryPtr dictionary;
|
||||
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return true;
|
||||
|
||||
if (m_pauseScripting)
|
||||
@@ -733,7 +733,7 @@ bool GameScriptObject::handleMessage(const std::string &messageName, const std::
|
||||
*/
|
||||
int GameScriptObject::callScriptCommandHandler(std::string const &funcName, ScriptParams ¶ms) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if (m_pauseScripting)
|
||||
@@ -757,7 +757,7 @@ int GameScriptObject::callScriptCommandHandler(std::string const &funcName, Scri
|
||||
*/
|
||||
int GameScriptObject::callScriptBuffHandler(std::string const &funcName, ScriptParams ¶ms) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return SCRIPT_CONTINUE;
|
||||
|
||||
if (m_pauseScripting)
|
||||
@@ -825,7 +825,7 @@ void GameScriptObject::enumerateScripts(std::vector<std::string> &scriptNames) c
|
||||
*/
|
||||
void GameScriptObject::makeScriptDictionary(const ScriptParams & params, ScriptDictionaryPtr & dictionary)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
{
|
||||
JavaDictionaryPtr jdp;
|
||||
JavaLibrary::instance()->convert(params, jdp);
|
||||
@@ -840,7 +840,7 @@ void GameScriptObject::makeScriptDictionary(const ScriptParams & params, ScriptD
|
||||
*/
|
||||
bool GameScriptObject::isScriptingEnabled(void)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
return true;
|
||||
return false;
|
||||
} // GameScriptObject::isScriptingEnabled
|
||||
@@ -854,7 +854,7 @@ bool GameScriptObject::isScriptingEnabled(void)
|
||||
*/
|
||||
bool GameScriptObject::reloadScript(const std::string& scriptName)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -904,7 +904,7 @@ bool GameScriptObject::reloadScript(const std::string& scriptName)
|
||||
*/
|
||||
void GameScriptObject::enableLogging(bool enable)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
JavaLibrary::instance()->enableLogging(enable);
|
||||
} // GameScriptObject::enableLogging
|
||||
|
||||
@@ -917,7 +917,7 @@ void GameScriptObject::enableLogging(bool enable)
|
||||
*/
|
||||
void GameScriptObject::enableNewJediTracking(bool enableTracking)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
JavaLibrary::instance()->enableNewJediTracking(enableTracking);
|
||||
} // GameScriptObject::enableNewJediTracking
|
||||
|
||||
@@ -946,7 +946,7 @@ Scheduler & GameScriptObject::getScriptScheduler()
|
||||
|
||||
void GameScriptObject::onStopWatching(ServerObject & subject)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
if (m_owner)
|
||||
@@ -959,7 +959,7 @@ void GameScriptObject::onStopWatching(ServerObject & subject)
|
||||
|
||||
void GameScriptObject::onWatching(ServerObject & subject)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
if (m_owner)
|
||||
@@ -972,7 +972,7 @@ void GameScriptObject::onWatching(ServerObject & subject)
|
||||
|
||||
void GameScriptObject::runOneScript(const std::string & scriptName, const std::string & methodName, const std::string & argTypes, ScriptParams & args)
|
||||
{
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
IGNORE_RETURN( JavaLibrary::instance()->runScript(NetworkId(), scriptName, methodName, argTypes, args) );
|
||||
}
|
||||
|
||||
@@ -994,7 +994,7 @@ std::string GameScriptObject::callScriptConsoleHandler(const std::string & scrip
|
||||
{
|
||||
static const std::string errorReturnString;
|
||||
|
||||
if (JavaLibrary::instance() != NULL)
|
||||
if (JavaLibrary::instance() != nullptr)
|
||||
{
|
||||
return JavaLibrary::instance()->callScriptConsoleHandler(scriptName, methodName, argTypes, args);
|
||||
}
|
||||
@@ -1019,7 +1019,7 @@ void GameScriptObject::callSpaceClearOvert(const NetworkId &ship)
|
||||
|
||||
std::string GameScriptObject::callDumpTargetInfo( NetworkId &id )
|
||||
{
|
||||
if( JavaLibrary::instance() != NULL )
|
||||
if( JavaLibrary::instance() != nullptr )
|
||||
{
|
||||
return JavaLibrary::instance()->getObjectDumpInfo( id );
|
||||
}
|
||||
@@ -1030,7 +1030,7 @@ std::string GameScriptObject::callDumpTargetInfo( NetworkId &id )
|
||||
|
||||
void GameScriptObject::setScriptVar(const std::string & name, int value)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::setScriptVar(*m_owner, name, value);
|
||||
@@ -1040,7 +1040,7 @@ void GameScriptObject::setScriptVar(const std::string & name, int value)
|
||||
|
||||
void GameScriptObject::setScriptVar(const std::string & name, float value)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::setScriptVar(*m_owner, name, value);
|
||||
@@ -1050,7 +1050,7 @@ void GameScriptObject::setScriptVar(const std::string & name, float value)
|
||||
|
||||
void GameScriptObject::setScriptVar(const std::string & name, const std::string & value)
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::setScriptVar(*m_owner, name, value);
|
||||
@@ -1060,7 +1060,7 @@ void GameScriptObject::setScriptVar(const std::string & name, const std::string
|
||||
|
||||
void GameScriptObject::packAllScriptVarDeltas()
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL)
|
||||
if (JavaLibrary::instance() == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::packAllDeltaScriptVars();
|
||||
@@ -1070,7 +1070,7 @@ void GameScriptObject::packAllScriptVarDeltas()
|
||||
|
||||
void GameScriptObject::clearScriptVars()
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::clearScriptVars(*m_owner);
|
||||
@@ -1080,7 +1080,7 @@ void GameScriptObject::clearScriptVars()
|
||||
|
||||
void GameScriptObject::packScriptVars(std::vector<int8> & target) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::packScriptVars(*m_owner, target);
|
||||
@@ -1090,7 +1090,7 @@ void GameScriptObject::packScriptVars(std::vector<int8> & target) const
|
||||
|
||||
void GameScriptObject::unpackScriptVars(const std::vector<int8> & source) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
JavaLibrary::unpackScriptVars(*m_owner, source);
|
||||
@@ -1100,7 +1100,7 @@ void GameScriptObject::unpackScriptVars(const std::vector<int8> & source) const
|
||||
|
||||
void GameScriptObject::unpackDeltaScriptVars(const std::vector<int8> & data) const
|
||||
{
|
||||
if (JavaLibrary::instance() == NULL || m_owner == NULL)
|
||||
if (JavaLibrary::instance() == nullptr || m_owner == nullptr)
|
||||
return;
|
||||
|
||||
DEBUG_REPORT_LOG(! m_owner, ("A game script object received a request to unpack script var synchronization data, but it has no owner object!!! All GameScriptObjects MUST have owners!\n"));
|
||||
@@ -1238,18 +1238,18 @@ namespace Archive
|
||||
|
||||
GameScriptObject * GameScriptObject::asGameScriptObject(Object * const object)
|
||||
{
|
||||
ServerObject * const serverObject = (object != NULL) ? object->asServerObject() : NULL;
|
||||
ServerObject * const serverObject = (object != nullptr) ? object->asServerObject() : nullptr;
|
||||
|
||||
return (serverObject != NULL) ? serverObject->getScriptObject() : NULL;
|
||||
return (serverObject != nullptr) ? serverObject->getScriptObject() : nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
GameScriptObject const * GameScriptObject::asGameScriptObject(Object const * const object)
|
||||
{
|
||||
ServerObject const * const serverObject = (object != NULL) ? object->asServerObject() : NULL;
|
||||
ServerObject const * const serverObject = (object != nullptr) ? object->asServerObject() : nullptr;
|
||||
|
||||
return (serverObject != NULL) ? serverObject->getScriptObject() : NULL;
|
||||
return (serverObject != nullptr) ? serverObject->getScriptObject() : nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -90,7 +90,7 @@ LocalRefPtr createNewObject(jclass clazz, jmethodID constructorID, ...)
|
||||
|
||||
JavaStringPtr createNewString(const char * bytes)
|
||||
{
|
||||
if (bytes != NULL)
|
||||
if (bytes != nullptr)
|
||||
{
|
||||
JavaStringPtr result(new JavaString(JavaLibrary::getEnv()->NewStringUTF(bytes)));
|
||||
if (result->getValue() != 0)
|
||||
@@ -103,7 +103,7 @@ JavaStringPtr createNewString(const char * bytes)
|
||||
|
||||
JavaStringPtr createNewString(const jchar * unicodeChars, jsize len)
|
||||
{
|
||||
if (unicodeChars != NULL && len >= 0)
|
||||
if (unicodeChars != nullptr && len >= 0)
|
||||
{
|
||||
JavaStringPtr result(new JavaString(JavaLibrary::getEnv()->NewString(unicodeChars, len)));
|
||||
if (result->getValue() != 0)
|
||||
@@ -902,7 +902,7 @@ LocalRef::LocalRef(jobject src) :
|
||||
|
||||
LocalRef::~LocalRef()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteLocalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ LocalArrayRef::LocalArrayRef(jarray src) :
|
||||
|
||||
LocalArrayRef::~LocalArrayRef()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteLocalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
@@ -932,7 +932,7 @@ LocalObjectArrayRef::LocalObjectArrayRef(jobjectArray src) :
|
||||
|
||||
LocalObjectArrayRef::~LocalObjectArrayRef()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteLocalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
@@ -1002,13 +1002,13 @@ LocalLongArrayRef::~LocalLongArrayRef()
|
||||
GlobalRef::GlobalRef(const LocalRefParam & src) :
|
||||
LocalRefParam(static_cast<jobject>(0))
|
||||
{
|
||||
if (src.getValue() != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (src.getValue() != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
m_ref = JavaLibrary::getEnv()->NewGlobalRef(src.getValue());
|
||||
}
|
||||
|
||||
GlobalRef::~GlobalRef()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteGlobalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
@@ -1019,13 +1019,13 @@ GlobalRef::~GlobalRef()
|
||||
GlobalArrayRef::GlobalArrayRef(const LocalObjectArrayRefParam & src) :
|
||||
LocalObjectArrayRefParam(static_cast<jobjectArray>(0))
|
||||
{
|
||||
if (src.getValue() != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (src.getValue() != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
m_ref = JavaLibrary::getEnv()->NewGlobalRef(src.getValue());
|
||||
}
|
||||
|
||||
GlobalArrayRef::~GlobalArrayRef()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteGlobalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
@@ -1048,10 +1048,10 @@ JavaStringParam::~JavaStringParam()
|
||||
|
||||
int JavaStringParam::fillBuffer(char * buffer, int size) const
|
||||
{
|
||||
if (m_ref != 0 && buffer != NULL && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && buffer != nullptr && JavaLibrary::getEnv() != nullptr)
|
||||
{
|
||||
// Get the number of storage bytes required to convert this Java string into a UTF-8 string.
|
||||
// Include the terminating null byte in the required buffer size.
|
||||
// Include the terminating nullptr byte in the required buffer size.
|
||||
int requiredBufferSize = JavaLibrary::getEnv()->GetStringUTFLength(static_cast<jstring>(m_ref)) + 1;
|
||||
if (requiredBufferSize <= size)
|
||||
{
|
||||
@@ -1059,7 +1059,7 @@ int JavaStringParam::fillBuffer(char * buffer, int size) const
|
||||
|
||||
JavaLibrary::getEnv()->GetStringUTFRegion(static_cast<jstring>(m_ref), 0, stringLength, buffer);
|
||||
|
||||
// Null terminate the string. requiredBufferSize already includes the byte count for the null terminator.
|
||||
// Null terminate the string. requiredBufferSize already includes the byte count for the nullptr terminator.
|
||||
buffer[requiredBufferSize - 1] = '\0';
|
||||
|
||||
return requiredBufferSize;
|
||||
@@ -1077,7 +1077,7 @@ JavaString::JavaString(jstring src) :
|
||||
}
|
||||
|
||||
JavaString::JavaString(const char * src) :
|
||||
JavaStringParam(JavaLibrary::getEnv()->NewStringUTF(src != NULL ? src : ""))
|
||||
JavaStringParam(JavaLibrary::getEnv()->NewStringUTF(src != nullptr ? src : ""))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1093,7 +1093,7 @@ JavaString::JavaString(const Unicode::String & src) :
|
||||
|
||||
JavaString::~JavaString()
|
||||
{
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != NULL)
|
||||
if (m_ref != 0 && JavaLibrary::getEnv() != nullptr)
|
||||
JavaLibrary::getEnv()->DeleteLocalRef(m_ref);
|
||||
m_ref = 0;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -434,7 +434,7 @@ static const Scripting::ScriptFuncTable ScriptFuncList[] =
|
||||
|
||||
//-- finish it up
|
||||
|
||||
{Scripting::TRIG_LAST_TRIGGER, NULL, NULL}
|
||||
{Scripting::TRIG_LAST_TRIGGER, nullptr, nullptr}
|
||||
};
|
||||
|
||||
const int NUM_SCRIPT_FUNCTIONS = sizeof(ScriptFuncList) / sizeof(ScriptFuncList[0]) - 1;
|
||||
@@ -444,7 +444,7 @@ const int NUM_SCRIPT_FUNCTIONS = sizeof(ScriptFuncList) / sizeof(ScriptFuncList[
|
||||
// globals
|
||||
//========================================================================
|
||||
|
||||
Scripting::_ScriptFuncHashMap *Scripting::ScriptFuncHashMap = NULL;
|
||||
Scripting::_ScriptFuncHashMap *Scripting::ScriptFuncHashMap = nullptr;
|
||||
|
||||
|
||||
//========================================================================
|
||||
@@ -468,6 +468,6 @@ void Scripting::InitScriptFuncHashMap(void)
|
||||
void Scripting::RemoveScriptFuncHashMap(void)
|
||||
{
|
||||
delete Scripting::ScriptFuncHashMap;
|
||||
Scripting::ScriptFuncHashMap = NULL;
|
||||
Scripting::ScriptFuncHashMap = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ std::string const &ScriptListEntry::getScriptName() const
|
||||
{
|
||||
static const std::string emptyString;
|
||||
|
||||
if (m_data != NULL)
|
||||
if (m_data != nullptr)
|
||||
return m_data->first;
|
||||
WARNING_STRICT_FATAL(true, ("ScriptListEntry::getScriptName called with m_data = NULL"));
|
||||
WARNING_STRICT_FATAL(true, ("ScriptListEntry::getScriptName called with m_data = nullptr"));
|
||||
return emptyString;
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ ScriptData &ScriptListEntry::getScriptData() const
|
||||
{
|
||||
static ScriptData emptyData;
|
||||
|
||||
if (m_data != NULL)
|
||||
if (m_data != nullptr)
|
||||
return m_data->second;
|
||||
WARNING_STRICT_FATAL(true, ("ScriptListEntry::getScriptData called with m_data = NULL"));
|
||||
WARNING_STRICT_FATAL(true, ("ScriptListEntry::getScriptData called with m_data = nullptr"));
|
||||
return emptyData;
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ inline bool ScriptListEntry::operator==(ScriptListEntry const &rhs) const
|
||||
|
||||
inline bool ScriptListEntry::isValid() const
|
||||
{
|
||||
return m_data != NULL;
|
||||
return m_data != nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -126,18 +126,18 @@ AICreatureController * const ScriptMethodsAiNamespace::getAiCreatureController(j
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("Unable to resolve the ai(%s) to a CreatureObject.", aiNetworkId.getValueString().c_str()));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("Unable to get the ai's(%s) AiCreatureController.", aiCreatureObject->getDebugInformation().c_str()));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return aiCreatureController;
|
||||
@@ -155,14 +155,14 @@ jint JNICALL ScriptMethodsAiNamespace::aiGetMovementState(JNIEnv * /*env*/, jobj
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return AMT_invalid;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return AMT_invalid;
|
||||
}
|
||||
@@ -187,14 +187,14 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiLoggingEnabled(JNIEnv * /*env*/, jo
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsFrozen(JNIEnv * /*env*/, jobject
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -226,14 +226,14 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsAggressive(JNIEnv * /*env*/, jobj
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -247,14 +247,14 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsAssist(JNIEnv * /*env*/, jobject
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsStalker(JNIEnv * /*env*/, jobject
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -282,14 +282,14 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsKiller(JNIEnv * /*env*/, jobject
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ void JNICALL ScriptMethodsAiNamespace::aiTether(JNIEnv * /*env*/, jobject /*self
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -316,14 +316,14 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiIsTethered(JNIEnv * /*env*/, jobjec
|
||||
NetworkId const aiNetworkId(ai);
|
||||
CreatureObject * const aiCreatureObject = CreatureObject::getCreatureObject(aiNetworkId);
|
||||
|
||||
if (aiCreatureObject == NULL)
|
||||
if (aiCreatureObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(aiCreatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -336,7 +336,7 @@ void JNICALL ScriptMethodsAiNamespace::aiSetHomeLocation(JNIEnv * /*env*/, jobje
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ jobject JNICALL ScriptMethodsAiNamespace::aiGetHomeLocation(JNIEnv * /*env*/, jo
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JavaLibrary::getVector(Vector::zero)->getReturnValue();
|
||||
}
|
||||
@@ -373,7 +373,7 @@ jobject JNICALL ScriptMethodsAiNamespace::aiGetLeashAnchorLocation(JNIEnv * /*en
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JavaLibrary::getVector(Vector::zero)->getReturnValue();
|
||||
}
|
||||
@@ -396,7 +396,7 @@ jfloat JNICALL ScriptMethodsAiNamespace::aiGetRespectRadius(JNIEnv * /*env*/, jo
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ jfloat JNICALL ScriptMethodsAiNamespace::aiGetAggroRadius(JNIEnv * /*env*/, jobj
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -424,7 +424,7 @@ void JNICALL ScriptMethodsAiNamespace::aiEquipPrimaryWeapon(JNIEnv * /*env*/, jo
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ void JNICALL ScriptMethodsAiNamespace::aiEquipSecondaryWeapon(JNIEnv * /*env*/,
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ void JNICALL ScriptMethodsAiNamespace::aiUnEquipWeapons(JNIEnv * /*env*/, jobjec
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -463,7 +463,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiHasPrimaryWeapon(JNIEnv * /*env*/,
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -476,7 +476,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiHasSecondaryWeapon(JNIEnv * /*env*/
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -489,7 +489,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiUsingPrimaryWeapon(JNIEnv * /*env*/
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -502,7 +502,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::aiUsingSecondaryWeapon(JNIEnv * /*env
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -515,7 +515,7 @@ jlong JNICALL ScriptMethodsAiNamespace::aiGetPrimaryWeapon(JNIEnv * /*env*/, job
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -528,7 +528,7 @@ jlong JNICALL ScriptMethodsAiNamespace::aiGetSecondaryWeapon(JNIEnv * /*env*/, j
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -541,7 +541,7 @@ jfloat JNICALL ScriptMethodsAiNamespace::aiGetMovementSpeedPercent(JNIEnv * /*en
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -554,7 +554,7 @@ void JNICALL ScriptMethodsAiNamespace::loiterLocation(JNIEnv * /*env*/, jobject
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -585,7 +585,7 @@ void JNICALL ScriptMethodsAiNamespace::loiterLocation(JNIEnv * /*env*/, jobject
|
||||
|
||||
CellObject const * const cellObject = CellObject::getCellObject(cellId);
|
||||
|
||||
if (cellObject != NULL)
|
||||
if (cellObject != nullptr)
|
||||
{
|
||||
CellProperty const * const cellProperty = cellObject->getCellProperty();
|
||||
|
||||
@@ -608,7 +608,7 @@ void JNICALL ScriptMethodsAiNamespace::loiterTarget(JNIEnv * /*env*/, jobject /*
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -623,7 +623,7 @@ void JNICALL ScriptMethodsAiNamespace::loiterTarget(JNIEnv * /*env*/, jobject /*
|
||||
NetworkId const targetNetworkId(static_cast<NetworkId::NetworkIdType>(target));
|
||||
Object * const targetObject = NetworkIdManager::getObjectById(targetNetworkId);
|
||||
|
||||
if (targetObject == NULL)
|
||||
if (targetObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsAi::loiterTarget() ai(%s) Unable to resolve the target(%s) to a Object", aiCreatureController->getCreature()->getDebugInformation().c_str(), targetNetworkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -643,7 +643,7 @@ void JNICALL ScriptMethodsAiNamespace::pathToLocation(JNIEnv * /*env*/, jobject
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -664,7 +664,7 @@ void JNICALL ScriptMethodsAiNamespace::pathToLocation(JNIEnv * /*env*/, jobject
|
||||
{
|
||||
CellObject const * const cellObject = CellObject::getCellObject(cellId);
|
||||
|
||||
if (cellObject != NULL)
|
||||
if (cellObject != nullptr)
|
||||
{
|
||||
CellProperty const * const cellProperty = cellObject->getCellProperty();
|
||||
|
||||
@@ -697,7 +697,7 @@ void JNICALL ScriptMethodsAiNamespace::pathToName(JNIEnv * /*env*/, jobject /*se
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -731,7 +731,7 @@ void JNICALL ScriptMethodsAiNamespace::pathToName(JNIEnv * /*env*/, jobject /*se
|
||||
void JNICALL ScriptMethodsAiNamespace::patrolToLocation(JNIEnv *, jobject, jlong ai, jobjectArray targets, jboolean random, jboolean flip, jboolean repeat, jint startPoint)
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
return;
|
||||
|
||||
std::vector<Location> locations;
|
||||
@@ -755,7 +755,7 @@ void JNICALL ScriptMethodsAiNamespace::patrolToLocation(JNIEnv *, jobject, jlong
|
||||
void JNICALL ScriptMethodsAiNamespace::patrolToName(JNIEnv *, jobject, jlong ai, jobjectArray targetNames, jboolean random, jboolean flip, jboolean repeat, jint startPoint)
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
return;
|
||||
|
||||
std::vector<const Unicode::String *> locations;
|
||||
@@ -768,11 +768,11 @@ void JNICALL ScriptMethodsAiNamespace::patrolToName(JNIEnv *, jobject, jlong ai,
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
const Unicode::String * location = locations[i];
|
||||
if (location != NULL)
|
||||
if (location != nullptr)
|
||||
{
|
||||
realLocations.push_back(*location);
|
||||
delete location;
|
||||
locations[i] = NULL;
|
||||
locations[i] = nullptr;
|
||||
}
|
||||
}
|
||||
aiCreatureController->patrol(realLocations, random, flip, repeat, startPoint);
|
||||
@@ -783,16 +783,16 @@ jstring JNICALL ScriptMethodsAiNamespace::aiGetCombatAction(JNIEnv * /*env*/, jo
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PersistentCrcString const & result = aiCreatureController->getCombatAction();
|
||||
|
||||
if (result.isEmpty())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JavaString javaString(result.getString());
|
||||
@@ -805,7 +805,7 @@ jint JNICALL ScriptMethodsAiNamespace::aiGetKnockDownRecoveryTime(JNIEnv * /*env
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(ai);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -819,7 +819,7 @@ jboolean JNICALL ScriptMethodsAiNamespace::setHibernationDelay(JNIEnv *env, jobj
|
||||
{
|
||||
AICreatureController * const aiCreatureController = ScriptMethodsAiNamespace::getAiCreatureController(creature);
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
aiCreatureController->setHibernationDelay(delay);
|
||||
|
||||
@@ -97,7 +97,7 @@ void JNICALL ScriptMethodsAnimationNamespace::setAnimationMood (JNIEnv *env, job
|
||||
|
||||
JavaStringParam localMoodName(moodName);
|
||||
|
||||
ServerObject * targetObject = NULL;
|
||||
ServerObject * targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return;
|
||||
|
||||
@@ -114,7 +114,7 @@ void JNICALL ScriptMethodsAnimationNamespace::setAnimationMood (JNIEnv *env, job
|
||||
|
||||
jstring JNICALL ScriptMethodsAnimationNamespace::getAnimationMood (JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
ServerObject * targetObject = NULL;
|
||||
ServerObject * targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return 0;
|
||||
|
||||
@@ -143,7 +143,7 @@ jboolean JNICALL ScriptMethodsAnimationNamespace::sitOnObject (JNIEnv *env, jobj
|
||||
CreatureObject *sitterObject = 0;
|
||||
if (!JavaLibrary::getObject (sitterId, sitterObject) || !sitterObject)
|
||||
{
|
||||
DEBUG_WARNING (true, ("sitOnObject(): Sitter object is NULL."));
|
||||
DEBUG_WARNING (true, ("sitOnObject(): Sitter object is nullptr."));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -175,11 +175,11 @@ void JNICALL ScriptMethodsAnimationNamespace::setObjectAppearance(JNIEnv *env, j
|
||||
UNREF(env);
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject* creature = NULL;
|
||||
CreatureObject* creature = nullptr;
|
||||
|
||||
if(!JavaLibrary::getObject(target, creature) || !creature)
|
||||
{
|
||||
DEBUG_WARNING(true, ("SetObjectAppearance() : Creature object was NULL.\n"));
|
||||
DEBUG_WARNING(true, ("SetObjectAppearance() : Creature object was nullptr.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -209,11 +209,11 @@ void JNICALL ScriptMethodsAnimationNamespace::revertObjectAppearance(JNIEnv *env
|
||||
UNREF(env);
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject* creature = NULL;
|
||||
CreatureObject* creature = nullptr;
|
||||
|
||||
if(!JavaLibrary::getObject(target, creature) || !creature)
|
||||
{
|
||||
DEBUG_WARNING(true, ("RevertObjectAppearance() : Creature object was NULL.\n"));
|
||||
DEBUG_WARNING(true, ("RevertObjectAppearance() : Creature object was nullptr.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -549,12 +549,12 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::hasAttribModifier(JNIEnv *env
|
||||
if (!JavaLibrary::convert(jmodName, name))
|
||||
return JNI_FALSE;
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
const AttribMod::AttribMod * mod = creature->getAttributeModifier(name);
|
||||
if (mod != NULL && AttribMod::isAttribMod(*mod))
|
||||
if (mod != nullptr && AttribMod::isAttribMod(*mod))
|
||||
return JNI_TRUE;
|
||||
|
||||
return JNI_FALSE;
|
||||
@@ -582,12 +582,12 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::hasSkillModModifier(JNIEnv *e
|
||||
if (!JavaLibrary::convert(jmodName, name))
|
||||
return JNI_FALSE;
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
const AttribMod::AttribMod * mod = creature->getAttributeModifier(name);
|
||||
if (mod != NULL && AttribMod::isSkillMod(*mod))
|
||||
if (mod != nullptr && AttribMod::isSkillMod(*mod))
|
||||
return JNI_TRUE;
|
||||
|
||||
return JNI_FALSE;
|
||||
@@ -601,7 +601,7 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::hasSkillModModifier(JNIEnv *e
|
||||
* @param target id of creature to access
|
||||
* @param attrib attribute we are interested in
|
||||
*
|
||||
* @return the attribute modifiers for the creature, or null if it has none
|
||||
* @return the attribute modifiers for the creature, or nullptr if it has none
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsAttributesNamespace::getAttribModifiers(JNIEnv *env, jobject self, jlong target, jint attrib)
|
||||
{
|
||||
@@ -642,7 +642,7 @@ jobjectArray JNICALL ScriptMethodsAttributesNamespace::getAttribModifiers(JNIEnv
|
||||
* @param self class calling this function
|
||||
* @param target id of creature to access
|
||||
*
|
||||
* @return the attribute modifiers for the creature, or null if it has none
|
||||
* @return the attribute modifiers for the creature, or nullptr if it has none
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsAttributesNamespace::getAllAttribModifiers(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
@@ -692,7 +692,7 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::removeAttribModifier(JNIEnv *
|
||||
if (!JavaLibrary::convert(jmodName, name))
|
||||
return JNI_FALSE;
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1084,12 +1084,12 @@ jint JNICALL ScriptMethodsAttributesNamespace::getHitpoints(JNIEnv *env, jobject
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
@@ -1111,12 +1111,12 @@ jint JNICALL ScriptMethodsAttributesNamespace::getMaxHitpoints(JNIEnv *env, jobj
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
@@ -1136,13 +1136,13 @@ jint JNICALL ScriptMethodsAttributesNamespace::getTotalHitpoints(JNIEnv *env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
// make sure the object isn't a creature
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
@@ -1164,12 +1164,12 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::setHitpoints(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1209,12 +1209,12 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::setMaxHitpoints(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1237,12 +1237,12 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::setInvulnerableHitpoints(JNIE
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
// make sure the object isn't a creature or is a vehicle
|
||||
if (object->asCreatureObject () != NULL &&
|
||||
if (object->asCreatureObject () != nullptr &&
|
||||
!GameObjectTypes::isTypeOf (object->getGameObjectType (), SharedObjectTemplate::GOT_vehicle))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1280,7 +1280,7 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::setInvulnerableHitpoints(JNIE
|
||||
*/
|
||||
jint JNICALL ScriptMethodsAttributesNamespace::getShockWound(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return ATTRIB_ERROR;
|
||||
|
||||
@@ -1299,7 +1299,7 @@ jint JNICALL ScriptMethodsAttributesNamespace::getShockWound(JNIEnv *env, jobjec
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsAttributesNamespace::setShockWound(JNIEnv *env, jobject self, jlong target, jint wound)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1319,7 +1319,7 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::setShockWound(JNIEnv *env, jo
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsAttributesNamespace::addShockWound(JNIEnv *env, jobject self, jlong target, jint wound)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1339,7 +1339,7 @@ jboolean JNICALL ScriptMethodsAttributesNamespace::addShockWound(JNIEnv *env, jo
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsAttributesNamespace::healShockWound(JNIEnv *env, jobject self, jlong target, jint value)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@ void JNICALL ScriptMethodsAuctionNamespace::createVendorMarket(JNIEnv *env, jobj
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::auctionCreatePermanent(JNIEnv *env, jobject script, jstring jownerName, jlong jitem, jlong jauctionContainer, jint jprice, jstring juserDescription)
|
||||
{
|
||||
TangibleObject *itemObject = NULL;
|
||||
ServerObject *containerObj = NULL;
|
||||
TangibleObject *itemObject = nullptr;
|
||||
ServerObject *containerObj = nullptr;
|
||||
|
||||
if (!JavaLibrary::getObject(jitem, itemObject))
|
||||
{
|
||||
@@ -194,7 +194,7 @@ void JNICALL ScriptMethodsAuctionNamespace::setSalesTax(JNIEnv *env, jobject scr
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::requestVendorItemCount(JNIEnv *env, jobject script, jlong vendor)
|
||||
{
|
||||
ServerObject* vendorObject = NULL;
|
||||
ServerObject* vendorObject = nullptr;
|
||||
if( !JavaLibrary::getObject(vendor, vendorObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] requestVendorItemLimit() vendor is invalid."));
|
||||
@@ -206,7 +206,7 @@ void JNICALL ScriptMethodsAuctionNamespace::requestVendorItemCount(JNIEnv *env,
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::requestPlayerVendorCount(JNIEnv *env, jobject script, jlong player)
|
||||
{
|
||||
ServerObject* playerObject = NULL;
|
||||
ServerObject* playerObject = nullptr;
|
||||
if( !JavaLibrary::getObject(player, playerObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] requestPlayerVendorCount() player is invalid."));
|
||||
@@ -218,7 +218,7 @@ void JNICALL ScriptMethodsAuctionNamespace::requestPlayerVendorCount(JNIEnv *env
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::updateVendorSearchOption(JNIEnv *env, jobject script, jlong vendor, jboolean enable)
|
||||
{
|
||||
ServerObject* vendorObject = NULL;
|
||||
ServerObject* vendorObject = nullptr;
|
||||
bool enabled;
|
||||
if( !JavaLibrary::getObject(vendor, vendorObject) )
|
||||
{
|
||||
@@ -235,7 +235,7 @@ void JNICALL ScriptMethodsAuctionNamespace::updateVendorSearchOption(JNIEnv *env
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::setEntranceCharge(JNIEnv *env, jobject script, jlong vendor, jint entranceCharge)
|
||||
{
|
||||
ServerObject* vendorObject = NULL;
|
||||
ServerObject* vendorObject = nullptr;
|
||||
if( !JavaLibrary::getObject(vendor, vendorObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] setEntranceCharge() vendor is invalid."));
|
||||
@@ -247,7 +247,7 @@ void JNICALL ScriptMethodsAuctionNamespace::setEntranceCharge(JNIEnv *env, jobje
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::removeAllAuctions(JNIEnv *env, jobject script, jlong jvendor)
|
||||
{
|
||||
ServerObject* vendorObject = NULL;
|
||||
ServerObject* vendorObject = nullptr;
|
||||
if( !JavaLibrary::getObject(jvendor, vendorObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] removeAllAuctions() vendor is invalid."));
|
||||
@@ -259,21 +259,21 @@ void JNICALL ScriptMethodsAuctionNamespace::removeAllAuctions(JNIEnv *env, jobje
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::reinitializeVendor(JNIEnv *env, jobject script, jlong vendor, jlong player)
|
||||
{
|
||||
ServerObject* vendorObject = NULL;
|
||||
ServerObject* vendorObject = nullptr;
|
||||
if( !JavaLibrary::getObject(vendor, vendorObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] reinitializeVendor() vendor is invalid."));
|
||||
return;
|
||||
}
|
||||
ServerObject* auctionContainer = vendorObject->getBazaarContainer();
|
||||
if ( auctionContainer == NULL )
|
||||
if ( auctionContainer == nullptr )
|
||||
{
|
||||
WARNING(true, ("[designer bug] reinitializeVendor() vendor doesn't have an auction container."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ServerObject* playerObject = NULL;
|
||||
ServerObject* playerObject = nullptr;
|
||||
if ( !JavaLibrary::getObject(player, playerObject) )
|
||||
{
|
||||
WARNING(true, ("[designer bug] reinitializeVendor() player is invalid."));
|
||||
@@ -292,7 +292,7 @@ void JNICALL ScriptMethodsAuctionNamespace::reinitializeVendor(JNIEnv *env, jobj
|
||||
|
||||
void JNICALL ScriptMethodsAuctionNamespace::updateVendorStatus(JNIEnv *env, jobject script, jlong vendor, jint status)
|
||||
{
|
||||
ServerObject const * vendorObject = NULL;
|
||||
ServerObject const * vendorObject = nullptr;
|
||||
|
||||
if (!JavaLibrary::getObject(vendor, vendorObject))
|
||||
{
|
||||
|
||||
@@ -63,7 +63,7 @@ void JNICALL ScriptMethodsBroadcastingNamespace::listenToMessage(JNIEnv *env, jo
|
||||
CachedNetworkId emitterId(emitter);
|
||||
|
||||
ServerObject* listenerObject = dynamic_cast<ServerObject*>(listenerId.getObject());
|
||||
if (listenerObject == NULL)
|
||||
if (listenerObject == nullptr)
|
||||
return;
|
||||
|
||||
std::string messageHandlerNameString;
|
||||
@@ -88,7 +88,7 @@ void JNICALL ScriptMethodsBroadcastingNamespace::stopListeningToMessage(JNIEnv *
|
||||
CachedNetworkId emitterId(emitter);
|
||||
|
||||
ServerObject* listenerObject = dynamic_cast<ServerObject*>(listenerId.getObject());
|
||||
if (listenerObject == NULL)
|
||||
if (listenerObject == nullptr)
|
||||
return;
|
||||
|
||||
std::string messageHandlerNameString;
|
||||
@@ -112,7 +112,7 @@ jlongArray JNICALL ScriptMethodsBroadcastingNamespace::getMessageListeners(JNIEn
|
||||
CachedNetworkId emitterId(emitter);
|
||||
|
||||
ServerObject* emitterObject = dynamic_cast<ServerObject*>(emitterId.getObject());
|
||||
if (emitterObject == NULL)
|
||||
if (emitterObject == nullptr)
|
||||
return 0;
|
||||
|
||||
std::string messageHandlerNameString;
|
||||
|
||||
@@ -162,8 +162,8 @@ jboolean JNICALL ScriptMethodsBuffBuilderNamespace::buffBuilderValidated(JNIEnv
|
||||
WARNING(true, ("index keys and values arrays are of diffent sizes"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
jint * const buffComponentsValuesArray = env->GetIntArrayElements(jbuffComponentValues, NULL);
|
||||
if (buffComponentsValuesArray == NULL)
|
||||
jint * const buffComponentsValuesArray = env->GetIntArrayElements(jbuffComponentValues, nullptr);
|
||||
if (buffComponentsValuesArray == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ jboolean JNICALL ScriptMethodsBuffBuilderNamespace::buffBuilderValidated(JNIEnv
|
||||
{
|
||||
//send the final change message to the buffer to indicate acceptance
|
||||
|
||||
Controller * const bufferController = bufferObj ? bufferObj->getController() : NULL;
|
||||
Controller * const bufferController = bufferObj ? bufferObj->getController() : nullptr;
|
||||
if(bufferController)
|
||||
{
|
||||
BuffBuilderChangeMessage * outMsg = new BuffBuilderChangeMessage();
|
||||
|
||||
@@ -218,7 +218,7 @@ jstring JNICALL ScriptMethodsChatNamespace::chatPackOutOfBandWaypointData(JNIEnv
|
||||
Unicode::String n; //name
|
||||
StringId nid; //nameId
|
||||
|
||||
//-- target may be null, we'll just start a new string
|
||||
//-- target may be nullptr, we'll just start a new string
|
||||
if (target)
|
||||
{
|
||||
const JavaStringParam jtarget(target);
|
||||
@@ -229,7 +229,7 @@ jstring JNICALL ScriptMethodsChatNamespace::chatPackOutOfBandWaypointData(JNIEnv
|
||||
}
|
||||
}
|
||||
|
||||
//-- if planet is null, just use the current sceneId
|
||||
//-- if planet is nullptr, just use the current sceneId
|
||||
if (planet)
|
||||
{
|
||||
const JavaStringParam jplanet(planet);
|
||||
@@ -304,7 +304,7 @@ jstring JNICALL ScriptMethodsChatNamespace::chatPackOutOfBandWaypoint(JNIEnv * e
|
||||
|
||||
if (!source)
|
||||
{
|
||||
DEBUG_WARNING (true, ("ScriptMethodsChat JavaLibrary::chatPackOutOfBandWaypoint failed null source"));
|
||||
DEBUG_WARNING (true, ("ScriptMethodsChat JavaLibrary::chatPackOutOfBandWaypoint failed nullptr source"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ jstring JNICALL ScriptMethodsChatNamespace::packOutOfBandProsePackage(JNIEnv * e
|
||||
|
||||
if (!stringId)
|
||||
{
|
||||
DEBUG_WARNING (true, ("JavaLibrary::packOutOfBandProsePackage attempt to pack prose package with null stringId"));
|
||||
DEBUG_WARNING (true, ("JavaLibrary::packOutOfBandProsePackage attempt to pack prose package with nullptr stringId"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -644,10 +644,10 @@ void JNICALL ScriptMethodsChatNamespace::chatSendSystemMessageObjId(JNIEnv * env
|
||||
|
||||
if(!JavaLibrary::getObject(_to, player))
|
||||
{
|
||||
DEBUG_WARNING (true, ("ScriptMethodsChat JavaLibrary::chatSendSystemMessageObjId failed bad source object (not null)"));
|
||||
DEBUG_WARNING (true, ("ScriptMethodsChat JavaLibrary::chatSendSystemMessageObjId failed bad source object (not nullptr)"));
|
||||
if (ConfigServerScript::allowDebugConsoleMessages())
|
||||
{
|
||||
fprintf(stderr, "WARNING: JavaLibrary::chatSendSystemMessageObjId: failed bad source object (not null)\n");
|
||||
fprintf(stderr, "WARNING: JavaLibrary::chatSendSystemMessageObjId: failed bad source object (not nullptr)\n");
|
||||
JavaLibrary::printJavaStack();
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -920,7 +920,7 @@ void JNICALL ScriptMethodsCityNamespace::cityRemoveStructure(JNIEnv *env, jobjec
|
||||
|
||||
jboolean JNICALL ScriptMethodsCityNamespace::cityIsInactivePackupActive(JNIEnv *env, jobject self)
|
||||
{
|
||||
return (ConfigServerGame::getCityCitizenshipInactivePackupStartTimeEpoch() <= static_cast<int>(::time(NULL)));
|
||||
return (ConfigServerGame::getCityCitizenshipInactivePackupStartTimeEpoch() <= static_cast<int>(::time(nullptr)));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -91,7 +91,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObj(JNIEnv *
|
||||
{
|
||||
JavaStringParam localEventType(eventType);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
Client* c = so->getClient();
|
||||
@@ -100,7 +100,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObj(JNIEnv *
|
||||
if (!objectToPlayEventOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectToPlayEventOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -114,7 +114,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObj(JNIEnv *
|
||||
|
||||
//get the hardpoint
|
||||
std::string hp;
|
||||
if (NULL != jHardpoint)
|
||||
if (nullptr != jHardpoint)
|
||||
{
|
||||
JavaStringParam localHardpoint(jHardpoint);
|
||||
JavaLibrary::convert(localHardpoint, hp);
|
||||
@@ -122,7 +122,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObj(JNIEnv *
|
||||
|
||||
//get the transform
|
||||
Transform transform;
|
||||
if (NULL != jTransform)
|
||||
if (nullptr != jTransform)
|
||||
{
|
||||
ScriptConversion::convert(jTransform, transform);
|
||||
}
|
||||
@@ -158,7 +158,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObjLimited(J
|
||||
if (!objectToPlayEventOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectToPlayEventOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -172,7 +172,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObjLimited(J
|
||||
|
||||
//get the hardpoint
|
||||
std::string hp;
|
||||
if (NULL != jHardpoint)
|
||||
if (nullptr != jHardpoint)
|
||||
{
|
||||
JavaStringParam localHardpoint(jHardpoint);
|
||||
JavaLibrary::convert(localHardpoint, hp);
|
||||
@@ -180,7 +180,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventObjLimited(J
|
||||
|
||||
//get the transform
|
||||
Transform transform;
|
||||
if (NULL != jTransform)
|
||||
if (nullptr != jTransform)
|
||||
{
|
||||
ScriptConversion::convert(jTransform, transform);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEventLoc(JNIEnv *
|
||||
JavaStringParam localEventSourceType(eventSourceType);
|
||||
JavaStringParam localEventDestType(eventDestType);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
Client* c = so->getClient();
|
||||
@@ -281,7 +281,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObj(JNIEnv
|
||||
{
|
||||
JavaStringParam localEffectName(effectName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(objectToPlayEffectOn, so))
|
||||
return JNI_FALSE;
|
||||
/* TPERRY - This isn't used
|
||||
@@ -293,7 +293,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObj(JNIEnv
|
||||
if (!objectToPlayEffectOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectToPlayEffectOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -307,7 +307,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObj(JNIEnv
|
||||
|
||||
//get the hardpoint
|
||||
std::string hp;
|
||||
if (NULL != jHardpoint)
|
||||
if (nullptr != jHardpoint)
|
||||
{
|
||||
JavaStringParam localHardpoint(jHardpoint);
|
||||
JavaLibrary::convert(localHardpoint, hp);
|
||||
@@ -315,14 +315,14 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObj(JNIEnv
|
||||
|
||||
//get the transform
|
||||
Transform transform;
|
||||
if (NULL != jTransform)
|
||||
if (nullptr != jTransform)
|
||||
{
|
||||
ScriptConversion::convert(jTransform, transform);
|
||||
}
|
||||
|
||||
//get the optional labelName
|
||||
std::string strLabelName;
|
||||
if (NULL != labelName)
|
||||
if (nullptr != labelName)
|
||||
{
|
||||
JavaStringParam localLabel(labelName);
|
||||
JavaLibrary::convert(localLabel, strLabelName);
|
||||
@@ -360,7 +360,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObjLimited(
|
||||
if (!objectToPlayEffectOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectToPlayEffectOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -374,7 +374,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObjLimited(
|
||||
|
||||
//get the hardpoint
|
||||
std::string hp;
|
||||
if (NULL != jHardpoint)
|
||||
if (nullptr != jHardpoint)
|
||||
{
|
||||
JavaStringParam localHardpoint(jHardpoint);
|
||||
JavaLibrary::convert(localHardpoint, hp);
|
||||
@@ -382,14 +382,14 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectObjLimited(
|
||||
|
||||
//get the transform
|
||||
Transform transform;
|
||||
if (NULL != jTransform)
|
||||
if (nullptr != jTransform)
|
||||
{
|
||||
ScriptConversion::convert(jTransform, transform);
|
||||
}
|
||||
|
||||
//get the optional labelName
|
||||
std::string strLabelName;
|
||||
if (NULL != labelName)
|
||||
if (nullptr != labelName)
|
||||
{
|
||||
JavaStringParam localLabel(labelName);
|
||||
JavaLibrary::convert(localLabel, strLabelName);
|
||||
@@ -419,7 +419,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectLoc(JNIEnv
|
||||
{
|
||||
JavaStringParam localEffectName(effectName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -444,7 +444,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectLoc(JNIEnv
|
||||
|
||||
//get the optional labelName
|
||||
std::string strLabelName;
|
||||
if (NULL != labelName)
|
||||
if (nullptr != labelName)
|
||||
{
|
||||
JavaStringParam localLabel(labelName);
|
||||
JavaLibrary::convert(localLabel, strLabelName);
|
||||
@@ -482,7 +482,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playClientEffectLocLimited(
|
||||
|
||||
//get the optional labelName
|
||||
std::string strLabelName;
|
||||
if (NULL != labelName)
|
||||
if (nullptr != labelName)
|
||||
{
|
||||
JavaStringParam localLabel(labelName);
|
||||
JavaLibrary::convert(localLabel, strLabelName);
|
||||
@@ -501,7 +501,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playUiEffect(JNIEnv * /*env
|
||||
{
|
||||
JavaStringParam localUiEffectString(uiEffectString);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
{
|
||||
NetworkId const networkId(client);
|
||||
@@ -531,7 +531,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::stopClientEffectObjByLabel(
|
||||
{
|
||||
JavaStringParam localLabel(labelName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(objectEffectIsOn, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -545,7 +545,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::stopClientEffectObjByLabel(
|
||||
if (!objectEffectIsOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectEffectIsOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -578,7 +578,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::stopClientEffectObjByLabelL
|
||||
if (!objectEffectIsOn)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* target = NULL;
|
||||
ServerObject* target = nullptr;
|
||||
if(!JavaLibrary::getObject(objectEffectIsOn, target))
|
||||
return JNI_FALSE;
|
||||
if(!target)
|
||||
@@ -604,7 +604,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::play2dNonLoopingMusic(JNIEn
|
||||
{
|
||||
JavaStringParam localMusicName(musicName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
Client* c = so->getClient();
|
||||
@@ -628,7 +628,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::play2dNonLoopingSound(JNIEn
|
||||
{
|
||||
JavaStringParam localMusicName(musicName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
Client* c = so->getClient();
|
||||
@@ -652,7 +652,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::playMusicWithParms(JNIEnv *
|
||||
{
|
||||
JavaStringParam localMusicName(musicName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
Client* c = so->getClient();
|
||||
@@ -676,7 +676,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectile(JNIE
|
||||
{
|
||||
JavaStringParam localWeaponObjectTemplateName(weaponObjectTemplateName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -718,7 +718,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObjec
|
||||
{
|
||||
JavaStringParam localWeaponObjectTemplateName(weaponObjectTemplateName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -734,14 +734,14 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObjec
|
||||
return JNI_FALSE;
|
||||
|
||||
// Get our source object
|
||||
ServerObject* sourceObject = NULL;
|
||||
ServerObject* sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
NetworkId sourceId = sourceObject->getNetworkId();
|
||||
|
||||
// The target of our effect
|
||||
ServerObject* targetObject = NULL;
|
||||
ServerObject* targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -759,8 +759,8 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObjec
|
||||
|
||||
// Source's Cell ID
|
||||
CellProperty const * const cellProperty = sourceObject->getParentCell();
|
||||
Object const * const cellObject = (cellProperty != NULL) ? &cellProperty->getOwner() : NULL;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != NULL) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
Object const * const cellObject = (cellProperty != nullptr) ? &cellProperty->getOwner() : nullptr;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != nullptr) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
|
||||
CreateClientProjectileObjectToObjectMessage const ccpmoto(weaponObjectTemplateNameString, sourceId, sourceHardpointString, networkIdForCellOrWorld, targetId, targetHardpointString,
|
||||
speed, expiration, trail, PackedArgb(static_cast<uint8>(a), static_cast<uint8>(r), static_cast<uint8>(g), static_cast<uint8>(b)).getArgb());
|
||||
@@ -776,7 +776,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObje
|
||||
{
|
||||
JavaStringParam localWeaponObjectTemplateName(weaponObjectTemplateName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -792,7 +792,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObje
|
||||
return JNI_FALSE;
|
||||
|
||||
// Get our source object
|
||||
ServerObject* sourceObject = NULL;
|
||||
ServerObject* sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -812,8 +812,8 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileObje
|
||||
|
||||
// Source's Cell ID
|
||||
CellProperty const * const cellProperty = sourceObject->getParentCell();
|
||||
Object const * const cellObject = (cellProperty != NULL) ? &cellProperty->getOwner() : NULL;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != NULL) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
Object const * const cellObject = (cellProperty != nullptr) ? &cellProperty->getOwner() : nullptr;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != nullptr) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
|
||||
CreateClientProjectileObjectToLocationMessage const ccpmotl(weaponObjectTemplateNameString, sourceId, sourceHardpointString, networkIdForCellOrWorld, targetLocationVec,
|
||||
speed, expiration, trail, PackedArgb(static_cast<uint8>(a), static_cast<uint8>(r), static_cast<uint8>(g), static_cast<uint8>(b)).getArgb());
|
||||
@@ -829,7 +829,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileLocat
|
||||
{
|
||||
JavaStringParam localWeaponObjectTemplateName(weaponObjectTemplateName);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(client, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -845,7 +845,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileLocat
|
||||
return JNI_FALSE;
|
||||
|
||||
// Get our target object
|
||||
ServerObject* targetObject = NULL;
|
||||
ServerObject* targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -865,8 +865,8 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileLocat
|
||||
|
||||
// Target's Cell ID
|
||||
CellProperty const * const cellProperty = targetObject->getParentCell();
|
||||
Object const * const cellObject = (cellProperty != NULL) ? &cellProperty->getOwner() : NULL;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != NULL) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
Object const * const cellObject = (cellProperty != nullptr) ? &cellProperty->getOwner() : nullptr;
|
||||
NetworkId const & networkIdForCellOrWorld = (cellObject != nullptr) ? cellObject->getNetworkId() : NetworkId::cms_invalid;
|
||||
|
||||
CreateClientProjectileLocationToObjectMessage const ccpmlto(weaponObjectTemplateNameString, sourceLocationVec, networkIdForCellOrWorld, targetId, targetHardpointString,
|
||||
speed, expiration, trail, PackedArgb(static_cast<uint8>(a), static_cast<uint8>(r), static_cast<uint8>(g), static_cast<uint8>(b)).getArgb());
|
||||
@@ -878,7 +878,7 @@ jboolean JNICALL ScriptMethodsClientEffectNamespace::createClientProjectileLocat
|
||||
|
||||
void JNICALL ScriptMethodsClientEffectNamespace::addObjectEffect(JNIEnv * env, jobject self, jlong obj, jstring filename, jstring hardpoint, jobject offset, jfloat scale, jstring label)
|
||||
{
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(obj, so))
|
||||
return;
|
||||
|
||||
@@ -909,7 +909,7 @@ void JNICALL ScriptMethodsClientEffectNamespace::addObjectEffect(JNIEnv * env, j
|
||||
}
|
||||
void JNICALL ScriptMethodsClientEffectNamespace::removeObjectEffect(JNIEnv * env, jobject self, jlong obj, jstring label)
|
||||
{
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(obj, so))
|
||||
return;
|
||||
|
||||
@@ -929,7 +929,7 @@ void JNICALL ScriptMethodsClientEffectNamespace::removeObjectEffect(JNIEnv * env
|
||||
|
||||
void JNICALL ScriptMethodsClientEffectNamespace::removeAllObjectEffects(JNIEnv * env, jobject self, jlong obj)
|
||||
{
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(obj, so))
|
||||
return;
|
||||
|
||||
@@ -942,7 +942,7 @@ void JNICALL ScriptMethodsClientEffectNamespace::removeAllObjectEffects(JNIEnv *
|
||||
|
||||
jboolean JNICALL ScriptMethodsClientEffectNamespace::hasObjectEffect(JNIEnv * env, jobject self, jlong obj, jstring label)
|
||||
{
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if (!JavaLibrary::getObject(obj, so))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
*/
|
||||
LocalRefPtr JavaLibrary::convert(const ValueDictionary & source)
|
||||
{
|
||||
if (ms_env == NULL)
|
||||
if (ms_env == nullptr)
|
||||
return LocalRef::cms_nullPtr;
|
||||
|
||||
// create the dictionary
|
||||
@@ -150,7 +150,7 @@ void JavaLibrary::convert(const jobject & source, ValueDictionary & target)
|
||||
target.clear();
|
||||
|
||||
JNIEnv * env = getEnv();
|
||||
if (env == NULL)
|
||||
if (env == nullptr)
|
||||
return;
|
||||
|
||||
if (!env->IsInstanceOf(source, ms_clsDictionary))
|
||||
|
||||
@@ -211,12 +211,12 @@ const JNINativeMethod NATIVES[] = {
|
||||
void JavaLibrary::setupWeaponCombatData(JNIEnv *env, const WeaponObject * weapon,
|
||||
jobject weaponData)
|
||||
{
|
||||
if (env == NULL || weaponData == NULL)
|
||||
if (env == nullptr || weaponData == nullptr)
|
||||
return;
|
||||
|
||||
if (weapon == NULL)
|
||||
if (weapon == nullptr)
|
||||
{
|
||||
env->SetObjectField(weaponData, ms_fidCombatEngineWeaponDataId, NULL);
|
||||
env->SetObjectField(weaponData, ms_fidCombatEngineWeaponDataId, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getCombatDuration(JNIEnv * /*env*/, j
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject const * const tangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (tangibleObject == NULL)
|
||||
if (tangibleObject == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getCombatDuration(JNIEnv * /*env*/, j
|
||||
* @param self class calling this function
|
||||
* @param target id of the creature
|
||||
*
|
||||
* @return the object id of the weapon, or NULL on error
|
||||
* @return the object id of the weapon, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCombatNamespace::getCurrentWeapon(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
@@ -278,7 +278,7 @@ jlong JNICALL ScriptMethodsCombatNamespace::getCurrentWeapon(JNIEnv *env, jobjec
|
||||
return 0;
|
||||
|
||||
const WeaponObject * weapon = creature->getCurrentWeapon();
|
||||
if (weapon == NULL)
|
||||
if (weapon == nullptr)
|
||||
return 0;
|
||||
|
||||
return (weapon->getNetworkId()).getValue();
|
||||
@@ -313,7 +313,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::setCurrentWeapon(JNIEnv *env, job
|
||||
* @param self class calling this function
|
||||
* @param target id of the creature
|
||||
*
|
||||
* @return the object id of the weapon, or NULL on error
|
||||
* @return the object id of the weapon, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCombatNamespace::getHeldWeapon(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ jlong JNICALL ScriptMethodsCombatNamespace::getHeldWeapon(JNIEnv *env, jobject s
|
||||
return 0;
|
||||
|
||||
const WeaponObject * weapon = creature->getReadiedWeapon();
|
||||
if (weapon == NULL)
|
||||
if (weapon == nullptr)
|
||||
return 0;
|
||||
|
||||
return (weapon->getNetworkId()).getValue();
|
||||
@@ -337,7 +337,7 @@ jlong JNICALL ScriptMethodsCombatNamespace::getHeldWeapon(JNIEnv *env, jobject s
|
||||
* @param self class calling this function
|
||||
* @param target id of the creature
|
||||
*
|
||||
* @return the object id of the default weapon, or NULL on error
|
||||
* @return the object id of the default weapon, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCombatNamespace::getDefaultWeapon(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
@@ -348,7 +348,7 @@ UNREF(self);
|
||||
return 0;
|
||||
|
||||
const WeaponObject * weapon = creature->getDefaultWeapon();
|
||||
if (weapon == NULL)
|
||||
if (weapon == nullptr)
|
||||
return 0;
|
||||
|
||||
return (weapon->getNetworkId()).getValue();
|
||||
@@ -422,7 +422,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::isDefaultWeapon(JNIEnv *env, jobj
|
||||
return JNI_FALSE;
|
||||
|
||||
const CreatureObject * owner = dynamic_cast<const CreatureObject *>(ContainerInterface::getContainedByObject(*weapon));
|
||||
if (owner == NULL || owner->getDefaultWeapon() != weapon)
|
||||
if (owner == nullptr || owner->getDefaultWeapon() != weapon)
|
||||
return JNI_FALSE;
|
||||
|
||||
return JNI_TRUE;
|
||||
@@ -441,7 +441,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getMinRange(JNIEnv *env, jobject se
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1.0f;
|
||||
|
||||
@@ -462,7 +462,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getMaxRange(JNIEnv *env, jobject se
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1.0f;
|
||||
|
||||
@@ -483,7 +483,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getAverageDamage(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -506,7 +506,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponType(JNIEnv *env, jobject se
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -527,7 +527,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponAttackType(JNIEnv *env, jobj
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -546,7 +546,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponDamageType(JNIEnv *env, jobj
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -590,7 +590,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponMinDamage(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -636,7 +636,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponMaxDamage(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -682,7 +682,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getWeaponAttackSpeed(JNIEnv *env, j
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1.0f;
|
||||
|
||||
@@ -728,7 +728,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getWeaponWoundChance(JNIEnv *env, j
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1.0f;
|
||||
|
||||
@@ -743,13 +743,13 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getWeaponWoundChance(JNIEnv *env, j
|
||||
* @param self class calling this function
|
||||
* @param weaponId the id of the weapon
|
||||
*
|
||||
* @return the range info, or null on error
|
||||
* @return the range info, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCombatNamespace::getWeaponRangeInfo(JNIEnv *env, jobject self, jlong weaponId)
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -827,7 +827,7 @@ jfloat JNICALL ScriptMethodsCombatNamespace::getWeaponDamageRadius(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1.0f;
|
||||
|
||||
@@ -865,7 +865,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::setWeaponDamageRadius(JNIEnv *env
|
||||
*/
|
||||
jfloat JNICALL ScriptMethodsCombatNamespace::getAudibleRange(JNIEnv *env, jobject self, jlong weaponId)
|
||||
{
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return -1;
|
||||
|
||||
@@ -887,7 +887,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponAttackCost(JNIEnv *env, jobj
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -932,7 +932,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponAccuracy(JNIEnv *env, jobjec
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -977,7 +977,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponElementalType(JNIEnv *env, j
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -1022,7 +1022,7 @@ jint JNICALL ScriptMethodsCombatNamespace::getWeaponElementalValue(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const WeaponObject *weapon = NULL;
|
||||
const WeaponObject *weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return 0;
|
||||
|
||||
@@ -1218,7 +1218,7 @@ void _startCombat(char const * const functionName, jlong attacker, jlong defende
|
||||
NetworkId const attackerId(attacker);
|
||||
TangibleObject * const attackerTangibleObject = TangibleObject::getTangibleObject(attackerId);
|
||||
|
||||
if (attackerTangibleObject == NULL)
|
||||
if (attackerTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsCombat::%s() Unable to resolve the attacker(%s) to a TangibleObject.", functionName, attackerId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1227,7 +1227,7 @@ void _startCombat(char const * const functionName, jlong attacker, jlong defende
|
||||
NetworkId const defenderId(defender);
|
||||
TangibleObject * const defenderTangibleObject = TangibleObject::getTangibleObject(defenderId);
|
||||
|
||||
if (defenderTangibleObject == NULL)
|
||||
if (defenderTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsCombat::%s() attacker(%s) Unable to resolve the defender(%s) to a TangibleObject.", functionName, attackerId.getValueString().c_str(), defenderId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1302,7 +1302,7 @@ void JNICALL ScriptMethodsCombatNamespace::stopCombat(JNIEnv * /*env*/, jobject
|
||||
NetworkId const objectId(object);
|
||||
TangibleObject * const tangibleObject = TangibleObject::getTangibleObject(objectId);
|
||||
|
||||
if (tangibleObject == NULL)
|
||||
if (tangibleObject == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1334,9 +1334,9 @@ int i;
|
||||
int attackerCount = 0;
|
||||
int defenderCount = 0;
|
||||
|
||||
if (attackers != NULL)
|
||||
if (attackers != nullptr)
|
||||
attackerCount = env->GetArrayLength(attackers);
|
||||
if (defenders != NULL)
|
||||
if (defenders != nullptr)
|
||||
defenderCount = env->GetArrayLength(defenders);
|
||||
|
||||
// get the attacker and weapon data
|
||||
@@ -1348,22 +1348,22 @@ int i;
|
||||
LocalRefPtr weaponData = getObjectArrayElement(LocalObjectArrayRefParam(weaponsData), i);
|
||||
if (!attackerId)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData got null attacker id"));
|
||||
WARNING(true, ("JavaLibrary::getCombatData got nullptr attacker id"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
if (attackerData == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData got null attacker data"));
|
||||
WARNING(true, ("JavaLibrary::getCombatData got nullptr attacker data"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
if (weaponData == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData got null weapon data"));
|
||||
WARNING(true, ("JavaLibrary::getCombatData got nullptr weapon data"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
// set up the attacker data
|
||||
const TangibleObject * attacker = NULL;
|
||||
const TangibleObject * attacker = nullptr;
|
||||
if (!JavaLibrary::getObject(attackerId, attacker))
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot get attacker object"));
|
||||
@@ -1377,7 +1377,7 @@ int i;
|
||||
ScriptConversion::convert(attacker->getPosition_p(), attacker->getSceneId(),
|
||||
attackerCell ? attackerCell->getNetworkId() : NetworkId::cms_invalid,
|
||||
location);
|
||||
if (location.get() == NULL || location == LocalRef::cms_nullPtr)
|
||||
if (location.get() == nullptr || location == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot convert local position "
|
||||
"of attacker %s to Java", attacker->getNetworkId().getValueString().c_str()));
|
||||
@@ -1390,7 +1390,7 @@ int i;
|
||||
ScriptConversion::convert(attacker->getPosition_w(), attacker->getSceneId(),
|
||||
CellProperty::getWorldCellProperty()->getOwner().getNetworkId(),
|
||||
worldLocation);
|
||||
if (worldLocation.get() == NULL || worldLocation == LocalRef::cms_nullPtr)
|
||||
if (worldLocation.get() == nullptr || worldLocation == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot convert world position "
|
||||
"of attacker %s to Java", attacker->getNetworkId().getValueString().c_str()));
|
||||
@@ -1398,14 +1398,14 @@ int i;
|
||||
}
|
||||
}
|
||||
|
||||
const WeaponObject * weapon = NULL;
|
||||
const WeaponObject * weapon = nullptr;
|
||||
bool isCreature = false;
|
||||
int posture = 0;
|
||||
int locomotion = 0;
|
||||
int weaponSkill = 0;
|
||||
int aims = 0;
|
||||
const CreatureObject * creature = dynamic_cast<const CreatureObject *>(attacker);
|
||||
if (creature != NULL)
|
||||
if (creature != nullptr)
|
||||
{
|
||||
isCreature = true;
|
||||
posture = creature->getPosture();
|
||||
@@ -1419,7 +1419,7 @@ int i;
|
||||
|
||||
CombatEngineData::CombatData const * combatData = attacker->getCombatData();
|
||||
|
||||
if (combatData != NULL)
|
||||
if (combatData != nullptr)
|
||||
{
|
||||
aims = combatData->attackData.aims;
|
||||
}
|
||||
@@ -1446,17 +1446,17 @@ int i;
|
||||
LocalRefPtr defenderData = getObjectArrayElement(LocalObjectArrayRefParam(defendersData), i);
|
||||
if (!defenderId)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData got null defender id"));
|
||||
WARNING(true, ("JavaLibrary::getCombatData got nullptr defender id"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
if (defenderData == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData got null defender data"));
|
||||
WARNING(true, ("JavaLibrary::getCombatData got nullptr defender data"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
// set up the defender data
|
||||
const TangibleObject * defender = NULL;
|
||||
const TangibleObject * defender = nullptr;
|
||||
if (!JavaLibrary::getObject(defenderId, defender))
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot get defender object"));
|
||||
@@ -1470,7 +1470,7 @@ int i;
|
||||
ScriptConversion::convert(defender->getPosition_p(), defender->getSceneId(),
|
||||
defenderCell ? defenderCell->getNetworkId() : NetworkId::cms_invalid,
|
||||
location);
|
||||
if (location.get() == NULL || location == LocalRef::cms_nullPtr)
|
||||
if (location.get() == nullptr || location == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot convert local position "
|
||||
"of defender %s to Java", defender->getNetworkId().getValueString().c_str()));
|
||||
@@ -1483,7 +1483,7 @@ int i;
|
||||
ScriptConversion::convert(defender->getPosition_w(), defender->getSceneId(),
|
||||
CellProperty::getWorldCellProperty()->getOwner().getNetworkId(),
|
||||
worldLocation);
|
||||
if (worldLocation.get() == NULL || worldLocation == LocalRef::cms_nullPtr)
|
||||
if (worldLocation.get() == nullptr || worldLocation == LocalRef::cms_nullPtr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCombatData cannot convert world position "
|
||||
"of defender %s to Java", defender->getNetworkId().getValueString().c_str()));
|
||||
@@ -1497,7 +1497,7 @@ int i;
|
||||
int combatSkeleton = defender->getCombatSkeleton();
|
||||
int cover = 0;
|
||||
const CreatureObject * creature = dynamic_cast<const CreatureObject *>(defender);
|
||||
if (creature != NULL)
|
||||
if (creature != nullptr)
|
||||
{
|
||||
isCreature = true;
|
||||
posture = creature->getPosture();
|
||||
@@ -1557,7 +1557,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::getWeaponData(JNIEnv *env, jobjec
|
||||
if (weapon == 0 || weaponData == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
const WeaponObject * localWeapon = NULL;
|
||||
const WeaponObject * localWeapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weapon, localWeapon))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1587,15 +1587,15 @@ jboolean JNICALL ScriptMethodsCombatNamespace::doDamage(JNIEnv *env, jobject sel
|
||||
if (damage <= 0)
|
||||
return JNI_TRUE;
|
||||
|
||||
TangibleObject * attacker = NULL;
|
||||
TangibleObject * attacker = nullptr;
|
||||
if (!JavaLibrary::getObject(attackerId, attacker))
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject * defender = NULL;
|
||||
TangibleObject * defender = nullptr;
|
||||
if (!JavaLibrary::getObject(defenderId, defender))
|
||||
return JNI_FALSE;
|
||||
|
||||
WeaponObject * weapon = NULL;
|
||||
WeaponObject * weapon = nullptr;
|
||||
if (!JavaLibrary::getObject(weaponId, weapon))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1627,11 +1627,11 @@ jboolean JNICALL ScriptMethodsCombatNamespace::doDamageNoWeapon(JNIEnv *env, job
|
||||
if (damage <= 0)
|
||||
return JNI_TRUE;
|
||||
|
||||
TangibleObject * attacker = NULL;
|
||||
TangibleObject * attacker = nullptr;
|
||||
if (!JavaLibrary::getObject(attackerId, attacker))
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject * defender = NULL;
|
||||
TangibleObject * defender = nullptr;
|
||||
if (!JavaLibrary::getObject(defenderId, defender))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1699,7 +1699,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::doCombatResults(JNIEnv *env, jobj
|
||||
{
|
||||
message->setAttacker(attacker, weapon);
|
||||
CreatureObject * creature = dynamic_cast<CreatureObject *>(attacker.getObject());
|
||||
if (creature != NULL)
|
||||
if (creature != nullptr)
|
||||
{
|
||||
Postures::Enumerator posture = static_cast<Postures::Enumerator>(
|
||||
env->GetIntField(attackerResult, JavaLibrary::getFidBaseClassAttackerResultsPosture()));
|
||||
@@ -1816,7 +1816,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::doCombatResults(JNIEnv *env, jobj
|
||||
// send the message
|
||||
|
||||
Controller *const controller = attacker.getObject()->getController();
|
||||
if (controller != NULL)
|
||||
if (controller != nullptr)
|
||||
{
|
||||
float f_hold_ms = ConfigServerGame::getCombatDamageDelaySeconds() * 1000.0f;
|
||||
if ( f_hold_ms < 1.0 ) // 0 hold time (allowing for rounding error)
|
||||
@@ -1834,7 +1834,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::doCombatResults(JNIEnv *env, jobj
|
||||
{
|
||||
MessageQueueCombatAction *held = (MessageQueueCombatAction*)controller->peekHeldMessage( CM_combatAction );
|
||||
bool b_merge = true;
|
||||
if ( held == NULL )
|
||||
if ( held == nullptr )
|
||||
b_merge = false;
|
||||
else if ( held->getComparisonChecksum() != message->getComparisonChecksum() )
|
||||
b_merge = false;
|
||||
@@ -1900,24 +1900,24 @@ jboolean JNICALL ScriptMethodsCombatNamespace::callDefenderCombatAction(JNIEnv *
|
||||
{
|
||||
// use the attacker's current weapon
|
||||
CreatureObject * creatureAttacker = dynamic_cast<CreatureObject *>(attackerId.getObject());
|
||||
if (creatureAttacker != NULL)
|
||||
if (creatureAttacker != nullptr)
|
||||
{
|
||||
const WeaponObject * weaponObject = creatureAttacker->getCurrentWeapon();
|
||||
if (weaponObject != NULL)
|
||||
if (weaponObject != nullptr)
|
||||
weaponId = weaponObject->getNetworkId();
|
||||
}
|
||||
else
|
||||
{
|
||||
const WeaponObject * weaponAttacker = dynamic_cast<const WeaponObject *>(
|
||||
attackerId.getObject());
|
||||
if (weaponAttacker != NULL)
|
||||
if (weaponAttacker != nullptr)
|
||||
weaponId = weaponAttacker->getNetworkId();
|
||||
}
|
||||
}
|
||||
|
||||
// call the trigger for each defender
|
||||
jint * resultsArray = env->GetIntArrayElements(results, NULL);
|
||||
if (resultsArray == NULL)
|
||||
jint * resultsArray = env->GetIntArrayElements(results, nullptr);
|
||||
if (resultsArray == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
for (jsize i = 0; i < defenderCount; ++i)
|
||||
@@ -1927,11 +1927,11 @@ jboolean JNICALL ScriptMethodsCombatNamespace::callDefenderCombatAction(JNIEnv *
|
||||
if (defender)
|
||||
{
|
||||
CachedNetworkId defenderId(defender);
|
||||
if (defenderId.getObject() != NULL)
|
||||
if (defenderId.getObject() != nullptr)
|
||||
{
|
||||
ServerObject * defenderObject = safe_cast<ServerObject *>(
|
||||
defenderId.getObject());
|
||||
if (defenderObject->getScriptObject() != NULL)
|
||||
if (defenderObject->getScriptObject() != nullptr)
|
||||
{
|
||||
ScriptParams params;
|
||||
params.addParam(attackerId);
|
||||
@@ -1961,7 +1961,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::callDefenderCombatAction(JNIEnv *
|
||||
*/
|
||||
void JNICALL ScriptMethodsCombatNamespace::setWantSawAttackTriggers(JNIEnv *env, jobject self, jlong obj, jboolean enable)
|
||||
{
|
||||
TangibleObject * tangible = NULL;
|
||||
TangibleObject * tangible = nullptr;
|
||||
|
||||
if (!JavaLibrary::getObject(obj, tangible))
|
||||
{
|
||||
@@ -2021,7 +2021,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::addSlowDownEffect(JNIEnv *env, jo
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
CreatureObject * attackerObject = NULL;
|
||||
CreatureObject * attackerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(attacker, attackerObject))
|
||||
{
|
||||
WARNING(true, ("[script bug] JavaLibrary::addSlowDownEffect called "
|
||||
@@ -2029,7 +2029,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::addSlowDownEffect(JNIEnv *env, jo
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
const TangibleObject * defenderObject = NULL;
|
||||
const TangibleObject * defenderObject = nullptr;
|
||||
if (!JavaLibrary::getObject(defender, defenderObject))
|
||||
{
|
||||
WARNING(true, ("[script bug] JavaLibrary::addSlowDownEffect called "
|
||||
@@ -2057,7 +2057,7 @@ jboolean JNICALL ScriptMethodsCombatNamespace::addSlowDownEffect(JNIEnv *env, jo
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsCombatNamespace::removeSlowDownEffect(JNIEnv *env, jobject self, jlong attacker)
|
||||
{
|
||||
CreatureObject * attackerObject = NULL;
|
||||
CreatureObject * attackerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(attacker, attackerObject))
|
||||
{
|
||||
WARNING(true, ("[script bug] JavaLibrary::removeSlowDownEffect called "
|
||||
@@ -2090,14 +2090,14 @@ void JNICALL ScriptMethodsCombatNamespace::sendCombatSpam(JNIEnv *env, jobject s
|
||||
{
|
||||
NetworkId attackerId(attacker);
|
||||
ServerObject * attackerObj = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(attackerId));
|
||||
if (attackerObj == NULL)
|
||||
if (attackerObj == nullptr)
|
||||
{
|
||||
WARNING(true, ("WARNING: JavaLibrary::sendCombatSpam could not find attacker for id %s", attackerId.getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkId defenderId(defender);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : NULL);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : nullptr);
|
||||
|
||||
NetworkId weaponId(weapon);
|
||||
StringId attackNameSid;
|
||||
@@ -2189,14 +2189,14 @@ void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamWeaponString(JNIEnv *en
|
||||
{
|
||||
NetworkId attackerId(attacker);
|
||||
ServerObject * attackerObj = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(attackerId));
|
||||
if (attackerObj == NULL)
|
||||
if (attackerObj == nullptr)
|
||||
{
|
||||
WARNING(true, ("WARNING: JavaLibrary::sendCombatSpam could not find attacker for id %s", attackerId.getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
NetworkId defenderId(defender);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : NULL);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : nullptr);
|
||||
|
||||
StringId weaponNameSid;
|
||||
if (!ScriptConversion::convert(weaponName, weaponNameSid))
|
||||
@@ -2287,12 +2287,12 @@ void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamWeaponString(JNIEnv *en
|
||||
*/
|
||||
void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamMessage(JNIEnv *env, jobject self, jlong attacker, jlong defender, jobject message, jboolean sendToAttacker, jboolean sendToDefender, jboolean sendToBystanders, jint spamType)
|
||||
{
|
||||
ServerObject * attackerObj = NULL;
|
||||
ServerObject * attackerObj = nullptr;
|
||||
if (!JavaLibrary::getObject(attacker, attackerObj))
|
||||
return;
|
||||
|
||||
NetworkId defenderId(defender);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : NULL);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : nullptr);
|
||||
|
||||
StringId messageSid;
|
||||
if (!ScriptConversion::convert(message, messageSid))
|
||||
@@ -2322,12 +2322,12 @@ void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamMessage(JNIEnv *env, jo
|
||||
*/
|
||||
void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamMessageCGP(JNIEnv *env, jobject self, jlong attacker, jlong defender, jobject message, jboolean sendToAttacker, jboolean sendToDefender, jboolean sendToBystanders, jboolean critical, jboolean glancing, jboolean proc, jint spamType)
|
||||
{
|
||||
ServerObject * attackerObj = NULL;
|
||||
ServerObject * attackerObj = nullptr;
|
||||
if (!JavaLibrary::getObject(attacker, attackerObj))
|
||||
return;
|
||||
|
||||
NetworkId defenderId(defender);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : NULL);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : nullptr);
|
||||
|
||||
StringId messageSid;
|
||||
if (!ScriptConversion::convert(message, messageSid))
|
||||
@@ -2353,12 +2353,12 @@ void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamMessageCGP(JNIEnv *env,
|
||||
*/
|
||||
void JNICALL ScriptMethodsCombatNamespace::sendCombatSpamMessageOob(JNIEnv *env, jobject self, jlong attacker, jlong defender, jstring oob, jboolean sendToAttacker, jboolean sendToDefender, jboolean sendToBystanders, jint spamType)
|
||||
{
|
||||
ServerObject * attackerObj = NULL;
|
||||
ServerObject * attackerObj = nullptr;
|
||||
if (!JavaLibrary::getObject(attacker, attackerObj))
|
||||
return;
|
||||
|
||||
NetworkId defenderId(defender);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : NULL);
|
||||
Object const * const defenderObj = (defenderId.isValid() ? NetworkIdManager::getObjectById(defenderId) : nullptr);
|
||||
|
||||
Unicode::String oobString;
|
||||
if (!JavaLibrary::convert(JavaStringParam(oob), oobString))
|
||||
|
||||
@@ -97,7 +97,7 @@ jboolean JNICALL ScriptMethodsCommandQueueNamespace::queueCommand(JNIEnv *env, j
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::queueCommand() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -142,7 +142,7 @@ jboolean JNICALL ScriptMethodsCommandQueueNamespace::queueClear(JNIEnv *env, job
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::queueClear() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -170,7 +170,7 @@ jboolean JNICALL ScriptMethodsCommandQueueNamespace::queueHasCommandFromGroup(JN
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::queueHasCommandFromGroup() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -196,7 +196,7 @@ jboolean JNICALL ScriptMethodsCommandQueueNamespace::queueClearCommandsFromGroup
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::queueClearCommandsFromGroup() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -239,14 +239,14 @@ jboolean JNICALL ScriptMethodsCommandQueueNamespace::setCommandTimerValue( JNIEn
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::setCommandTimerValue() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
CommandQueue * const queue = actorTangibleObject->getCommandQueue();
|
||||
|
||||
if (queue == NULL)
|
||||
if (queue == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::setCommandTimerValue() object(%s) does not have a CommandQueue", actorTangibleObject->getDebugInformation().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -267,7 +267,7 @@ jint JNICALL ScriptMethodsCommandQueueNamespace::getCurrentCommand( JNIEnv *env,
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCurrentCommand() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return 0;
|
||||
@@ -275,7 +275,7 @@ jint JNICALL ScriptMethodsCommandQueueNamespace::getCurrentCommand( JNIEnv *env,
|
||||
|
||||
CommandQueue const * const queue = actorTangibleObject->getCommandQueue();
|
||||
|
||||
if (queue == NULL)
|
||||
if (queue == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCurrentCommand() object(%s) does not have a CommandQueue", actorTangibleObject->getDebugInformation().c_str()));
|
||||
return 0;
|
||||
@@ -298,7 +298,7 @@ jfloat JNICALL ScriptMethodsCommandQueueNamespace::getCooldownTimeLeft( JNIEnv *
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCooldownTimeLeft() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return 0.0f;
|
||||
@@ -306,7 +306,7 @@ jfloat JNICALL ScriptMethodsCommandQueueNamespace::getCooldownTimeLeft( JNIEnv *
|
||||
|
||||
CommandQueue const * const queue = actorTangibleObject->getCommandQueue();
|
||||
|
||||
if (queue == NULL)
|
||||
if (queue == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCooldownTimeLeft() object(%s) does not have a CommandQueue", actorTangibleObject->getDebugInformation().c_str()));
|
||||
return 0.0f;
|
||||
@@ -329,7 +329,7 @@ jfloat JNICALL ScriptMethodsCommandQueueNamespace::getCooldownTimeLeftString( JN
|
||||
NetworkId actorId(actor);
|
||||
TangibleObject * const actorTangibleObject = TangibleObject::getTangibleObject(actorId);
|
||||
|
||||
if (actorTangibleObject == NULL)
|
||||
if (actorTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCooldownTimeLeftString() Unable to resolve actor(%s) to a TangibleObject", actorId.getValueString().c_str()));
|
||||
return 0.0f;
|
||||
@@ -347,13 +347,13 @@ jfloat JNICALL ScriptMethodsCommandQueueNamespace::getCooldownTimeLeftString( JN
|
||||
CommandQueue const * const queue = actorTangibleObject->getCommandQueue();
|
||||
float value = 0.0f;
|
||||
|
||||
if (queue == NULL)
|
||||
if (queue == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getCooldownTimeLeftString() object(%s) does not have a CommandQueue", actorTangibleObject->getDebugInformation().c_str()));
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
if (queue != NULL)
|
||||
if (queue != nullptr)
|
||||
{
|
||||
value = queue->getCooldownTimeLeft( out );
|
||||
}
|
||||
@@ -369,7 +369,7 @@ void JNICALL ScriptMethodsCommandQueueNamespace::sendCooldownGroupTimingOnly(JNI
|
||||
NetworkId actorId(actor);
|
||||
CreatureObject * const actorCreatureObject = CreatureObject::getCreatureObject(actorId);
|
||||
|
||||
if (actorCreatureObject == NULL)
|
||||
if (actorCreatureObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::sendCooldownGroupTimingOnly() Unable to resolve actor(%s) to a CreatureObject", actorId.getValueString().c_str()));
|
||||
return;
|
||||
|
||||
@@ -52,10 +52,10 @@ void JNICALL ScriptMethodsConsoleNamespace::consoleSendMessageObjId(JNIEnv * env
|
||||
const ServerObject* player = 0;
|
||||
if(!JavaLibrary::getObject(_to, player))
|
||||
{
|
||||
DEBUG_WARNING (true, ("ScriptMethodsConsole JavaLibrary::consoleSendMessageObjId failed bad source object (not null)"));
|
||||
DEBUG_WARNING (true, ("ScriptMethodsConsole JavaLibrary::consoleSendMessageObjId failed bad source object (not nullptr)"));
|
||||
if (ConfigServerScript::allowDebugConsoleMessages())
|
||||
{
|
||||
fprintf(stderr, "WARNING: ScriptMethodsConsole JavaLibrary::consoleSendMessageObjId: failed bad source object (not null)\n");
|
||||
fprintf(stderr, "WARNING: ScriptMethodsConsole JavaLibrary::consoleSendMessageObjId: failed bad source object (not nullptr)\n");
|
||||
JavaLibrary::printJavaStack();
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -136,7 +136,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
jint JNICALL ScriptMethodsContainersNamespace::getContainerType(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
//@todo use enum
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -151,7 +151,7 @@ jint JNICALL ScriptMethodsContainersNamespace::getContainerType(JNIEnv *env, job
|
||||
|
||||
jlongArray JNICALL ScriptMethodsContainersNamespace::getContents(JNIEnv *env, jobject self, jlong containerObj)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(containerObj, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -190,7 +190,7 @@ jlongArray JNICALL ScriptMethodsContainersNamespace::getContents(JNIEnv *env, jo
|
||||
|
||||
jlong JNICALL ScriptMethodsContainersNamespace::getContainedBy(JNIEnv *env, jobject self, jlong item)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return 0;
|
||||
|
||||
@@ -211,7 +211,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::contains(JNIEnv *env, jobject
|
||||
if (container_id.getValue() == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -226,11 +226,11 @@ jboolean JNICALL ScriptMethodsContainersNamespace::contains(JNIEnv *env, jobject
|
||||
jint JNICALL ScriptMethodsContainersNamespace::canPutIn(JNIEnv *env, jobject self, jlong target, jlong jcontainer)
|
||||
{
|
||||
const int unknownError = static_cast<int>(Container::CEC_Unknown);
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(jcontainer, containerOwner))
|
||||
return unknownError;
|
||||
|
||||
ServerObject * item = NULL;
|
||||
ServerObject * item = nullptr;
|
||||
if (!JavaLibrary::getObject(target, item))
|
||||
return unknownError;
|
||||
|
||||
@@ -248,11 +248,11 @@ jint JNICALL ScriptMethodsContainersNamespace::canPutIn(JNIEnv *env, jobject sel
|
||||
jint JNICALL ScriptMethodsContainersNamespace::canPutInSlot(JNIEnv *env, jobject self, jlong target, jlong jcontainer, jstring slot)
|
||||
{
|
||||
const int unknownError = static_cast<int>(Container::CEC_Unknown);
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(jcontainer, containerOwner))
|
||||
return unknownError;
|
||||
|
||||
ServerObject * item = NULL;
|
||||
ServerObject * item = nullptr;
|
||||
if (!JavaLibrary::getObject(target, item))
|
||||
return unknownError;
|
||||
|
||||
@@ -268,7 +268,7 @@ jint JNICALL ScriptMethodsContainersNamespace::canPutInSlot(JNIEnv *env, jobject
|
||||
if (slotId == SlotId::invalid)
|
||||
return static_cast<int>(Container::CEC_NoSlot);
|
||||
|
||||
IGNORE_RETURN(ContainerInterface::canTransferToSlot(*containerOwner, *item, slotId, NULL, tmp));
|
||||
IGNORE_RETURN(ContainerInterface::canTransferToSlot(*containerOwner, *item, slotId, nullptr, tmp));
|
||||
|
||||
return static_cast<int>(tmp);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ jlong JNICALL ScriptMethodsContainersNamespace::getObjectInSlot(JNIEnv *env, job
|
||||
{
|
||||
JavaStringParam localSlot(slot);
|
||||
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -301,7 +301,7 @@ jlong JNICALL ScriptMethodsContainersNamespace::getObjectInSlot(JNIEnv *env, job
|
||||
|
||||
jlong JNICALL ScriptMethodsContainersNamespace::getFirstParentInWorld(JNIEnv *env, jobject self, jlong item)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return 0;
|
||||
|
||||
@@ -316,7 +316,7 @@ jlong JNICALL ScriptMethodsContainersNamespace::getFirstParentInWorld(JNIEnv *en
|
||||
|
||||
jlong JNICALL ScriptMethodsContainersNamespace::getTopMostContainer(JNIEnv *env, jobject self, jlong item)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return 0;
|
||||
|
||||
@@ -331,7 +331,7 @@ jlong JNICALL ScriptMethodsContainersNamespace::getTopMostContainer(JNIEnv *env,
|
||||
|
||||
jint JNICALL ScriptMethodsContainersNamespace::getNumItemsIn(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -347,7 +347,7 @@ jint JNICALL ScriptMethodsContainersNamespace::getNumItemsIn(JNIEnv *env, jobjec
|
||||
void JNICALL ScriptMethodsContainersNamespace::destroyContents(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
#if 0 //@todo implement
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return;
|
||||
|
||||
@@ -359,11 +359,11 @@ void JNICALL ScriptMethodsContainersNamespace::destroyContents(JNIEnv *env, jobj
|
||||
|
||||
jint JNICALL ScriptMethodsContainersNamespace::moveContents(JNIEnv *env, jobject self, jlong containerA, jlong containerB)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(containerA, containerOwner))
|
||||
return 0;
|
||||
|
||||
ServerObject * targetContainer = NULL;
|
||||
ServerObject * targetContainer = nullptr;
|
||||
if (!JavaLibrary::getObject(containerB, targetContainer))
|
||||
return 0;
|
||||
|
||||
@@ -377,7 +377,7 @@ jint JNICALL ScriptMethodsContainersNamespace::moveContents(JNIEnv *env, jobject
|
||||
for (; iter != container->end(); ++iter)
|
||||
{
|
||||
ServerObject* item = safe_cast<ServerObject*>((*iter).getObject());
|
||||
if (item && ContainerInterface::transferItemToGeneralContainer(*targetContainer, *item, NULL, tmp))
|
||||
if (item && ContainerInterface::transferItemToGeneralContainer(*targetContainer, *item, nullptr, tmp))
|
||||
{
|
||||
++count;
|
||||
}
|
||||
@@ -389,20 +389,20 @@ jint JNICALL ScriptMethodsContainersNamespace::moveContents(JNIEnv *env, jobject
|
||||
|
||||
jint JNICALL ScriptMethodsContainersNamespace::moveObjects(JNIEnv *env, jobject self, jlongArray targets, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < env->GetArrayLength(targets); ++i)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
jlong jlongTmp;
|
||||
env->GetLongArrayRegion(targets, i, 1, &jlongTmp);
|
||||
if (JavaLibrary::getObject(jlongTmp, itemObj))
|
||||
{
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
if (ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, NULL, tmp))
|
||||
if (ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, nullptr, tmp))
|
||||
{
|
||||
++count;
|
||||
}
|
||||
@@ -417,15 +417,15 @@ jint JNICALL ScriptMethodsContainersNamespace::moveObjects(JNIEnv *env, jobject
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::putIn(JNIEnv *env, jobject self, jlong item, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
return ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, NULL, tmp);
|
||||
return ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, nullptr, tmp);
|
||||
|
||||
}
|
||||
|
||||
@@ -434,11 +434,11 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putIn(JNIEnv *env, jobject se
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::putInPosition(JNIEnv *env, jobject self, jlong item, jlong container, jobject pos)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -451,7 +451,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putInPosition(JNIEnv *env, jo
|
||||
tr.setPosition_p(newPos);
|
||||
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
return ContainerInterface::transferItemToCell(*containerOwner, *itemObj, tr, NULL, tmp);
|
||||
return ContainerInterface::transferItemToCell(*containerOwner, *itemObj, tr, nullptr, tmp);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@@ -459,20 +459,20 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putInPosition(JNIEnv *env, jo
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::putInAndSendError(JNIEnv *env, jobject self, jlong item, jlong container, jlong player)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
bool retval = ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, NULL, tmp);
|
||||
bool retval = ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, nullptr, tmp);
|
||||
if (!retval)
|
||||
{
|
||||
ServerObject * playerObj = NULL;
|
||||
ServerObject * playerObj = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObj))
|
||||
return JNI_FALSE;
|
||||
ContainerInterface::sendContainerMessageToClient(*playerObj, tmp);
|
||||
@@ -483,11 +483,11 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putInAndSendError(JNIEnv *env
|
||||
//--------------------------------------------------------------------------------------
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::putInOverloaded(JNIEnv *env, jobject self, jlong item, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -500,7 +500,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putInOverloaded(JNIEnv *env,
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = ContainerInterface::transferItemToVolumeContainer(*containerOwner, *itemObj, NULL, tmp, true);
|
||||
retval = ContainerInterface::transferItemToVolumeContainer(*containerOwner, *itemObj, nullptr, tmp, true);
|
||||
}
|
||||
|
||||
return retval;
|
||||
@@ -509,11 +509,11 @@ jboolean JNICALL ScriptMethodsContainersNamespace::putInOverloaded(JNIEnv *env,
|
||||
//--------------------------------------------------------------------------------------
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::equip(JNIEnv *env, jobject self, jlong item, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -521,7 +521,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equip(JNIEnv *env, jobject se
|
||||
if (!test)
|
||||
return JNI_FALSE;
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
return ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, NULL, tmp);
|
||||
return ContainerInterface::transferItemToGeneralContainer(*containerOwner, *itemObj, nullptr, tmp);
|
||||
|
||||
}
|
||||
|
||||
@@ -532,11 +532,11 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equipIn(JNIEnv *env, jobject
|
||||
JavaStringParam localSlot(slot);
|
||||
|
||||
//@todo better error checking for invalid slot name. Do it above too.
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -554,7 +554,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equipIn(JNIEnv *env, jobject
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
int arrangement = slotted ? slotted->getBestArrangementForSlot(slotName) : -1;
|
||||
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, NULL, tmp);
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, nullptr, tmp);
|
||||
|
||||
}
|
||||
|
||||
@@ -565,14 +565,14 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equipOverride(JNIEnv *env, j
|
||||
//This function will equip and object into the first valid arrangement, deleting objects if necessary.
|
||||
//Before it deletes things, it looks for a valid unoccupied arrangement.
|
||||
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
{
|
||||
DEBUG_WARNING(true, ("JNI: EquipOverride param container could not be found"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
{
|
||||
DEBUG_WARNING(true, ("JNI: EquipOverride param item could not be found"));
|
||||
@@ -592,7 +592,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equipOverride(JNIEnv *env, j
|
||||
if (slotContainer->getFirstUnoccupiedArrangement(*itemObj, arrangement, tmp))
|
||||
{
|
||||
//Found one
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, NULL, tmp);
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, nullptr, tmp);
|
||||
}
|
||||
|
||||
//Couldn't find an unoccupied arrangement, so it's time to delete objects to make room for this one
|
||||
@@ -634,14 +634,14 @@ jboolean JNICALL ScriptMethodsContainersNamespace::equipOverride(JNIEnv *env, j
|
||||
}
|
||||
}
|
||||
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, NULL, tmp);
|
||||
return ContainerInterface::transferItemToSlottedContainer(*containerOwner, *itemObj, arrangement, nullptr, tmp);
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
jint JNICALL ScriptMethodsContainersNamespace::getFilledVolume(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -656,7 +656,7 @@ jint JNICALL ScriptMethodsContainersNamespace::getFilledVolume(JNIEnv *env, jobj
|
||||
|
||||
jint JNICALL ScriptMethodsContainersNamespace::getTotalVolume(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -672,7 +672,7 @@ jint JNICALL ScriptMethodsContainersNamespace::getTotalVolume(JNIEnv *env, jobje
|
||||
|
||||
jint JNICALL ScriptMethodsContainersNamespace::getVolumeFree(JNIEnv *env, jobject self, jlong container)
|
||||
{
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
|
||||
@@ -691,7 +691,7 @@ void JNICALL ScriptMethodsContainersNamespace::sendContainerErrorToClient(JNIEnv
|
||||
if (errorCode == 0)
|
||||
return;
|
||||
|
||||
ServerObject * playerObject = NULL;
|
||||
ServerObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
{
|
||||
DEBUG_WARNING(true, ("Player object not found in sendContainerErrorToClient"));
|
||||
@@ -767,7 +767,7 @@ void JNICALL ScriptMethodsContainersNamespace::moveToOfflinePlayerDatapadAndUnlo
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::isInSecureTrade(JNIEnv *env, jobject self, jlong item)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -807,7 +807,7 @@ void JNICALL ScriptMethodsContainersNamespace::fixLoadWith(JNIEnv *env, jobject
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::addUserToAccessList(JNIEnv *env, jobject self, jlong object, jlong user)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -829,7 +829,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::addUserToAccessList(JNIEnv *e
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::removeUserFromAccessList(JNIEnv * env, jobject self, jlong object, jlong user)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -851,7 +851,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::removeUserFromAccessList(JNIE
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::clearUserAccessList(JNIEnv * env, jobject self, jlong object)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -871,7 +871,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::clearUserAccessList(JNIEnv *
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::addGuildToAccessList(JNIEnv *env, jobject self, jlong object, jint guild)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -891,7 +891,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::addGuildToAccessList(JNIEnv *
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::removeGuildFromAccessList(JNIEnv * env, jobject self, jlong object, jint guild)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -911,7 +911,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::removeGuildFromAccessList(JNI
|
||||
|
||||
jboolean JNICALL ScriptMethodsContainersNamespace::clearGuildAccessList(JNIEnv * env, jobject self, jlong object)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -931,7 +931,7 @@ jboolean JNICALL ScriptMethodsContainersNamespace::clearGuildAccessList(JNIEnv *
|
||||
|
||||
jlongArray JNICALL ScriptMethodsContainersNamespace::getUserAccessList(JNIEnv * env, jobject self, jlong object)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -970,7 +970,7 @@ jlongArray JNICALL ScriptMethodsContainersNamespace::getUserAccessList(JNIEnv *
|
||||
|
||||
jintArray JNICALL ScriptMethodsContainersNamespace::getGuildAccessList(JNIEnv * env, jobject self, jlong object)
|
||||
{
|
||||
ServerObject * itemObj = NULL;
|
||||
ServerObject * itemObj = nullptr;
|
||||
if (!JavaLibrary::getObject(object, itemObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ void ScriptMethodsCraftingNamespace::collectRangedIntVariableCallback(const std:
|
||||
* @param draftSchematic draft schematic the attribute belongs to
|
||||
* @param attribIndex index of the attribute
|
||||
*
|
||||
* @return the attribute instance, or NULL on error
|
||||
* @return the attribute instance, or nullptr on error
|
||||
*/
|
||||
LocalRefPtr JavaLibrary::createObjectAttribute(const ManufactureObjectInterface & manfSchematic,
|
||||
const DraftSchematicObject & draftSchematic, int attribIndex)
|
||||
@@ -291,7 +291,7 @@ LocalRefPtr JavaLibrary::createObjectAttribute(const ManufactureObjectInterface
|
||||
* @param manfSchematic manufacture schematic the attribute belongs to
|
||||
* @param attribName name of the attribute
|
||||
*
|
||||
* @return the attribute instance, or NULL on error
|
||||
* @return the attribute instance, or nullptr on error
|
||||
*/
|
||||
LocalRefPtr JavaLibrary::createExperimentAttribute(const ManufactureObjectInterface & manfSchematic,
|
||||
const StringId & attribName)
|
||||
@@ -341,7 +341,7 @@ int i;
|
||||
|
||||
const DraftSchematicObject * draft = DraftSchematicObject::getSchematic(
|
||||
source.getDraftSchematic());
|
||||
if (draft == NULL)
|
||||
if (draft == nullptr)
|
||||
return LocalRef::cms_nullPtr;
|
||||
|
||||
LocalRefPtr target = allocObject(ms_clsDraftSchematic);
|
||||
@@ -501,7 +501,7 @@ int i;
|
||||
|
||||
// set the customization info from the shared object template
|
||||
const ServerObjectTemplate * objectTemplate = draft->getCraftedObjectTemplate();
|
||||
if (objectTemplate == NULL)
|
||||
if (objectTemplate == nullptr)
|
||||
{
|
||||
return LocalRef::cms_nullPtr;
|
||||
}
|
||||
@@ -509,7 +509,7 @@ int i;
|
||||
ObjectTemplateList::fetch(objectTemplate->getSharedTemplate()));
|
||||
const SharedTangibleObjectTemplate * sharedTangibleTemplate = dynamic_cast<
|
||||
const SharedTangibleObjectTemplate *>(sharedTemplate);
|
||||
if (sharedTangibleTemplate != NULL)
|
||||
if (sharedTangibleTemplate != nullptr)
|
||||
{
|
||||
// New method using the AssetCustomizationManager mechanism.
|
||||
|
||||
@@ -818,9 +818,9 @@ int i;
|
||||
|
||||
// set the created item template crc value
|
||||
const ServerObjectTemplate * craftedTemplate = source.getCraftedObjectTemplate();
|
||||
if (craftedTemplate == NULL)
|
||||
if (craftedTemplate == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::convert DraftSchematicObject got null crafted "
|
||||
WARNING(true, ("JavaLibrary::convert DraftSchematicObject got nullptr crafted "
|
||||
"template for draft schematic %s", source.getObjectTemplateName()));
|
||||
return 0;
|
||||
}
|
||||
@@ -830,7 +830,7 @@ int i;
|
||||
const ServerDraftSchematicObjectTemplate * const sourceSchematicTemplate =
|
||||
safe_cast<const ServerDraftSchematicObjectTemplate *>(source.getObjectTemplate());
|
||||
NOT_NULL(sourceSchematicTemplate);
|
||||
if (sourceSchematicTemplate == NULL)
|
||||
if (sourceSchematicTemplate == nullptr)
|
||||
{
|
||||
// emergency case for release mode
|
||||
return 0;
|
||||
@@ -873,11 +873,11 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::startCraftingSession(JNIEnv *en
|
||||
UNREF(env);
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject* playerObj = NULL;
|
||||
CreatureObject* playerObj = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject* stationObj = NULL;
|
||||
TangibleObject* stationObj = nullptr;
|
||||
if (!JavaLibrary::getObject(station, stationObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -894,7 +894,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::startCraftingSession(JNIEnv *en
|
||||
* @param self class calling this function
|
||||
* @param crafter the player that was crafting
|
||||
* @param tool the crafting tool that was being used
|
||||
* @param prototype the prototype that was created (may be null)
|
||||
* @param prototype the prototype that was created (may be nullptr)
|
||||
*
|
||||
* @return true on success, false on fail
|
||||
*/
|
||||
@@ -908,11 +908,11 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::endCraftingSession(JNIEnv *env,
|
||||
if (prototype == 0)
|
||||
return JNI_TRUE;
|
||||
|
||||
CreatureObject * crafterObj = NULL;
|
||||
CreatureObject * crafterObj = nullptr;
|
||||
if (!JavaLibrary::getObject(crafter, crafterObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject * prototypeObj = NULL;
|
||||
TangibleObject * prototypeObj = nullptr;
|
||||
if (!JavaLibrary::getObject(prototype, prototypeObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -937,11 +937,11 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setCraftingLevelAndStation(JNIE
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject* creatureObject = NULL;
|
||||
CreatureObject* creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject))
|
||||
return JNI_FALSE;
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creatureObject);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
if (craftingLevel >= 0 && craftingLevel <= Crafting::MAX_CRAFTING_LEVEL)
|
||||
@@ -949,12 +949,12 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setCraftingLevelAndStation(JNIE
|
||||
|
||||
if (station != 0)
|
||||
{
|
||||
const TangibleObject * stationObject = NULL;
|
||||
const TangibleObject * stationObject = nullptr;
|
||||
const NetworkId stationId(station);
|
||||
if (stationId != NetworkId::cms_invalid)
|
||||
{
|
||||
stationObject = dynamic_cast<const TangibleObject *>(ServerWorld::findObjectByNetworkId(stationId));
|
||||
if (stationObject == NULL)
|
||||
if (stationObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
}
|
||||
playerObject->setCraftingStation(stationObject);
|
||||
@@ -976,11 +976,11 @@ jint JNICALL ScriptMethodsCraftingNamespace::getCraftingLevel(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject* creatureObject = NULL;
|
||||
const CreatureObject* creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject))
|
||||
return -1;
|
||||
const PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creatureObject);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return -1;
|
||||
|
||||
return playerObject->getCraftingLevel();
|
||||
@@ -999,11 +999,11 @@ jlong JNICALL ScriptMethodsCraftingNamespace::getCraftingStation(JNIEnv *env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject* creatureObject = NULL;
|
||||
const CreatureObject* creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject))
|
||||
return 0;
|
||||
const PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creatureObject);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return (playerObject->getCraftingStation()).getValue();
|
||||
@@ -1023,11 +1023,11 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::sendUseableDraftSchematics(JNIE
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject* creatureObject = NULL;
|
||||
CreatureObject* creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject))
|
||||
return JNI_FALSE;
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creatureObject);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::sendUseableDraftSchematics non-player "
|
||||
"object %s\n", creatureObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -1038,8 +1038,8 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::sendUseableDraftSchematics(JNIE
|
||||
if (count == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
jint * schematicsArray = env->GetIntArrayElements(schematics, NULL);
|
||||
if (schematicsArray != NULL)
|
||||
jint * schematicsArray = env->GetIntArrayElements(schematics, nullptr);
|
||||
if (schematicsArray != nullptr)
|
||||
{
|
||||
std::vector<uint32> schematicCrcs(schematicsArray, &schematicsArray[count]);
|
||||
playerObject->sendUseableDraftSchematics(schematicCrcs);
|
||||
@@ -1072,7 +1072,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicAttribute(JNIEnv *e
|
||||
if (manufacturingSchematic == 0 || attribute == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureObjectInterface * schematic = NULL;
|
||||
ManufactureObjectInterface * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1120,7 +1120,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicAttributes(JNIEnv *
|
||||
if (manufacturingSchematic == 0 || attributes == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureObjectInterface * schematic = NULL;
|
||||
ManufactureObjectInterface * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1169,7 +1169,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicAttributes(JNIEnv *
|
||||
* @param name name of the attribute to get
|
||||
* @param experiment flag that these are experimental attributes
|
||||
*
|
||||
* @return the attribute, or null on error
|
||||
* @return the attribute, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicAttribute(JNIEnv *env, jobject self, jlong manufacturingSchematic, jobject name, jboolean experiment)
|
||||
{
|
||||
@@ -1178,13 +1178,13 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicAttribute(JNIEnv *en
|
||||
if (manufacturingSchematic == 0 || name == 0)
|
||||
return 0;
|
||||
|
||||
ManufactureObjectInterface * schematic = NULL;
|
||||
ManufactureObjectInterface * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * draft = DraftSchematicObject::getSchematic(
|
||||
schematic->getDraftSchematic());
|
||||
if (draft == NULL)
|
||||
if (draft == nullptr)
|
||||
return 0;
|
||||
|
||||
StringId nameId;
|
||||
@@ -1210,7 +1210,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicAttribute(JNIEnv *en
|
||||
* @param names names of the attributes to get
|
||||
* @param experiment flag that these are experimental attributes
|
||||
*
|
||||
* @return the attributes, or null on error
|
||||
* @return the attributes, or nullptr on error
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsCraftingNamespace::getSchematicAttributes(JNIEnv *env, jobject self, jlong manufacturingSchematic, jobjectArray names, jboolean experiment)
|
||||
{
|
||||
@@ -1219,13 +1219,13 @@ jobjectArray JNICALL ScriptMethodsCraftingNamespace::getSchematicAttributes(JNIE
|
||||
if (manufacturingSchematic == 0)
|
||||
return 0;
|
||||
|
||||
ManufactureObjectInterface * schematic = NULL;
|
||||
ManufactureObjectInterface * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * draft = DraftSchematicObject::getSchematic(
|
||||
schematic->getDraftSchematic());
|
||||
if (draft == NULL)
|
||||
if (draft == nullptr)
|
||||
return 0;
|
||||
|
||||
int numAttribs = env->GetArrayLength(names);
|
||||
@@ -1276,7 +1276,7 @@ jobjectArray JNICALL ScriptMethodsCraftingNamespace::getSchematicAttributes(JNIE
|
||||
* @param manufacturingSchematic the schematic
|
||||
* @param experiment flag that these are experimental attributes
|
||||
*
|
||||
* @return the attributes, or null on error
|
||||
* @return the attributes, or nullptr on error
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsCraftingNamespace::getAllSchematicAttributes(JNIEnv *env, jobject self, jlong manufacturingSchematic, jboolean experiment)
|
||||
{
|
||||
@@ -1286,13 +1286,13 @@ jobjectArray JNICALL ScriptMethodsCraftingNamespace::getAllSchematicAttributes(J
|
||||
if (manufacturingSchematic == 0)
|
||||
return 0;
|
||||
|
||||
ManufactureObjectInterface * schematic = NULL;
|
||||
ManufactureObjectInterface * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * draft = DraftSchematicObject::getSchematic(
|
||||
schematic->getDraftSchematic());
|
||||
if (draft == NULL)
|
||||
if (draft == nullptr)
|
||||
return 0;
|
||||
|
||||
// set the attributes
|
||||
@@ -1337,7 +1337,7 @@ jobjectArray JNICALL ScriptMethodsCraftingNamespace::getAllSchematicAttributes(J
|
||||
* @param manufacturingSchematic the schematic to get the data from
|
||||
* @param attributeNames the experimental attributes we're interested about
|
||||
*
|
||||
* @return the draft_schematic object, or null on error
|
||||
* @return the draft_schematic object, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicForExperimentalAttributes(JNIEnv *env, jobject self, jlong manufacturingSchematic, jobjectArray attributeNames)
|
||||
{
|
||||
@@ -1348,13 +1348,13 @@ int i;
|
||||
if (manufacturingSchematic == 0 || attributeNames == 0)
|
||||
return 0;
|
||||
|
||||
const ManufactureObjectInterface * manfSchematic = NULL;
|
||||
const ManufactureObjectInterface * manfSchematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, manfSchematic))
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * draftSchematic = DraftSchematicObject::getSchematic(
|
||||
manfSchematic->getDraftSchematic());
|
||||
if (draftSchematic == NULL)
|
||||
if (draftSchematic == nullptr)
|
||||
return 0;
|
||||
|
||||
// create a draft_schematic object to return
|
||||
@@ -1481,7 +1481,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicExperimentMod(JNIEn
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1510,7 +1510,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicAppearances(JNIEnv
|
||||
if (manufacturingSchematic == 0 || appearances == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1550,7 +1550,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicCustomizations(JNIE
|
||||
if (manufacturingSchematic == 0 || customizations == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1596,7 +1596,7 @@ jint JNICALL ScriptMethodsCraftingNamespace::getSchematicItemCount(JNIEnv *env,
|
||||
if (manufacturingSchematic == 0)
|
||||
return -1;
|
||||
|
||||
const ManufactureSchematicObject * schematic = NULL;
|
||||
const ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return -1;
|
||||
|
||||
@@ -1622,7 +1622,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicItemCount(JNIEnv *e
|
||||
if (manufacturingSchematic == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1649,7 +1649,7 @@ jint JNICALL ScriptMethodsCraftingNamespace::getSchematicItemsPerContainer(JNIEn
|
||||
if (manufacturingSchematic == 0)
|
||||
return -1;
|
||||
|
||||
const ManufactureSchematicObject * schematic = NULL;
|
||||
const ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return -1;
|
||||
|
||||
@@ -1676,7 +1676,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicItemsPerContainer(J
|
||||
if (manufacturingSchematic == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1703,7 +1703,7 @@ jfloat JNICALL ScriptMethodsCraftingNamespace::getSchematicManufactureTime(JNIEn
|
||||
if (manufacturingSchematic == 0)
|
||||
return -1.0f;
|
||||
|
||||
const ManufactureSchematicObject * schematic = NULL;
|
||||
const ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return -1.0f;
|
||||
|
||||
@@ -1730,7 +1730,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSchematicManufactureTime(JNI
|
||||
if (manufacturingSchematic == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = NULL;
|
||||
ManufactureSchematicObject * schematic = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1754,7 +1754,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setCreatorXp(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * target = NULL;
|
||||
TangibleObject * target = nullptr;
|
||||
if (!JavaLibrary::getObject(object, target))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1778,7 +1778,7 @@ void JNICALL ScriptMethodsCraftingNamespace::getIngredientsForManufactureStation
|
||||
if (station == 0 || ingredients == 0)
|
||||
return;
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return;
|
||||
|
||||
@@ -1786,7 +1786,7 @@ void JNICALL ScriptMethodsCraftingNamespace::getIngredientsForManufactureStation
|
||||
return;
|
||||
|
||||
const ManufactureSchematicObject * const schematic = manfStation->getSchematic();
|
||||
if (schematic == NULL)
|
||||
if (schematic == nullptr)
|
||||
return;
|
||||
|
||||
static ManufactureSchematicObject::IngredientInfoVector iiv;
|
||||
@@ -1841,7 +1841,7 @@ void JNICALL ScriptMethodsCraftingNamespace::getIngredientsForManufactureStation
|
||||
* @param self class calling this function
|
||||
* @param station the station id
|
||||
*
|
||||
* @return the hopper id, or null on error
|
||||
* @return the hopper id, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationInputHopper(JNIEnv *env, jobject self, jlong station)
|
||||
{
|
||||
@@ -1850,12 +1850,12 @@ jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationInputHopper(J
|
||||
if (station == 0)
|
||||
return 0;
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return 0;
|
||||
|
||||
ServerObject * hopper = manfStation->getInputHopper();
|
||||
if (hopper == NULL)
|
||||
if (hopper == nullptr)
|
||||
return 0;
|
||||
|
||||
return (hopper->getNetworkId()).getValue();
|
||||
@@ -1870,7 +1870,7 @@ jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationInputHopper(J
|
||||
* @param self class calling this function
|
||||
* @param station the station id
|
||||
*
|
||||
* @return the hopper id, or null on error
|
||||
* @return the hopper id, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationOutputHopper(JNIEnv *env, jobject self, jlong station)
|
||||
{
|
||||
@@ -1879,12 +1879,12 @@ jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationOutputHopper(
|
||||
if (station == 0)
|
||||
return 0;
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return 0;
|
||||
|
||||
ServerObject * hopper = manfStation->getOutputHopper();
|
||||
if (hopper == NULL)
|
||||
if (hopper == nullptr)
|
||||
return 0;
|
||||
|
||||
return (hopper->getNetworkId()).getValue();
|
||||
@@ -1899,7 +1899,7 @@ jlong JNICALL ScriptMethodsCraftingNamespace::getManufactureStationOutputHopper(
|
||||
* @param self class calling this function
|
||||
* @param station the station id
|
||||
*
|
||||
* @return a string of the form <id> "*" <name>, or null if the station has no schematic
|
||||
* @return a string of the form <id> "*" <name>, or nullptr if the station has no schematic
|
||||
*/
|
||||
jstring JNICALL ScriptMethodsCraftingNamespace::getManufactureStationSchematic(JNIEnv *env, jobject self, jlong station)
|
||||
{
|
||||
@@ -1907,12 +1907,12 @@ jstring JNICALL ScriptMethodsCraftingNamespace::getManufactureStationSchematic(J
|
||||
|
||||
UNREF(self);
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return 0;
|
||||
|
||||
const ManufactureSchematicObject * manfSchematic = manfStation->getSchematic();
|
||||
if (manfSchematic == NULL)
|
||||
if (manfSchematic == nullptr)
|
||||
return 0;
|
||||
|
||||
return JavaString(
|
||||
@@ -1943,11 +1943,11 @@ void JNICALL ScriptMethodsCraftingNamespace::getValidManufactureSchematicsForSta
|
||||
if (player == 0 || station == 0 || schematics == 0)
|
||||
return;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature))
|
||||
return;
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return;
|
||||
|
||||
@@ -1997,11 +1997,11 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::hasValidManufactureSchematicsFo
|
||||
if (player == 0 || station == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2030,24 +2030,24 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::transferManufactureSchematicToP
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const ManufactureInstallationObject * manfStation = NULL;
|
||||
const ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureSchematicObject * schematic = manfStation->getSchematic();
|
||||
if (schematic == NULL)
|
||||
if (schematic == nullptr)
|
||||
return JNI_TRUE;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * datapad = playerCreature->getDatapad();
|
||||
if (datapad == NULL)
|
||||
if (datapad == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
Container::ContainerErrorCode tmp = Container::CEC_Success;
|
||||
if (ContainerInterface::transferItemToVolumeContainer(*datapad, *schematic, NULL, tmp))
|
||||
if (ContainerInterface::transferItemToVolumeContainer(*datapad, *schematic, nullptr, tmp))
|
||||
return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
} // JavaLibrary::transferManufactureSchematicToPlayer
|
||||
@@ -2068,15 +2068,15 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::transferManufactureSchematicToS
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
ManufactureSchematicObject * manfSchematic = NULL;
|
||||
ManufactureSchematicObject * manfSchematic = nullptr;
|
||||
if (!JavaLibrary::getObject(schematic, manfSchematic))
|
||||
return JNI_FALSE;
|
||||
|
||||
ManufactureInstallationObject * manfStation = NULL;
|
||||
ManufactureInstallationObject * manfStation = nullptr;
|
||||
if (!JavaLibrary::getObject(station, manfStation))
|
||||
return JNI_FALSE;
|
||||
|
||||
if (manfStation->addSchematic(*manfSchematic, NULL))
|
||||
if (manfStation->addSchematic(*manfSchematic, nullptr))
|
||||
return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
} // JavaLibrary::transferManufactureSchematicToStation
|
||||
@@ -2099,11 +2099,11 @@ void JNICALL ScriptMethodsCraftingNamespace::getRepairableObjectsForTool(JNIEnv
|
||||
if (player == 0 || tool == 0 || objects == 0)
|
||||
return;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature))
|
||||
return;
|
||||
|
||||
const TangibleObject * toolObject = NULL;
|
||||
const TangibleObject * toolObject = nullptr;
|
||||
if (!JavaLibrary::getObject(tool, toolObject))
|
||||
return;
|
||||
if (!toolObject->isRepairTool())
|
||||
@@ -2123,11 +2123,11 @@ void JNICALL ScriptMethodsCraftingNamespace::getRepairableObjectsForTool(JNIEnv
|
||||
// objects
|
||||
|
||||
const ServerObject * inventory = playerCreature->getInventory();
|
||||
if (inventory == NULL)
|
||||
if (inventory == nullptr)
|
||||
return;
|
||||
|
||||
const VolumeContainer * inventoryContainer = ContainerInterface::getVolumeContainer(*inventory);
|
||||
if (inventoryContainer == NULL)
|
||||
if (inventoryContainer == nullptr)
|
||||
return;
|
||||
|
||||
std::vector<Unicode::String> objList;
|
||||
@@ -2136,7 +2136,7 @@ void JNICALL ScriptMethodsCraftingNamespace::getRepairableObjectsForTool(JNIEnv
|
||||
{
|
||||
const CachedNetworkId & objId = (*iter);
|
||||
const TangibleObject * obj = safe_cast<const TangibleObject *>(objId.getObject());
|
||||
if (obj != NULL && !obj->isCraftingTool() && !obj->isRepairTool() &&
|
||||
if (obj != nullptr && !obj->isCraftingTool() && !obj->isRepairTool() &&
|
||||
obj->getDamageTaken() > 0)
|
||||
{
|
||||
if ((genericTool && (toolType & obj->getGameObjectType()) != 0) ||
|
||||
@@ -2172,22 +2172,22 @@ void JNICALL ScriptMethodsCraftingNamespace::getRepairableObjectsForTool(JNIEnv
|
||||
* @param self class calling this function
|
||||
* @param target the object
|
||||
*
|
||||
* @return an array with the bonus for each attribute, or null on error
|
||||
* @return an array with the bonus for each attribute, or nullptr on error
|
||||
*/
|
||||
jintArray JNICALL ScriptMethodsCraftingNamespace::getAttributeBonuses(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const ServerObject * object = NULL;
|
||||
const ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return 0;
|
||||
|
||||
std::vector<std::pair<int, int> > bonuses;
|
||||
if (object->asTangibleObject() != NULL)
|
||||
if (object->asTangibleObject() != nullptr)
|
||||
{
|
||||
object->asTangibleObject()->getAttribBonuses(bonuses);
|
||||
}
|
||||
else if (object->asManufactureSchematicObject() != NULL)
|
||||
else if (object->asManufactureSchematicObject() != nullptr)
|
||||
{
|
||||
object->asManufactureSchematicObject()->getAttribBonuses(bonuses);
|
||||
}
|
||||
@@ -2235,16 +2235,16 @@ jint JNICALL ScriptMethodsCraftingNamespace::getAttributeBonus(JNIEnv *env, jobj
|
||||
if (attribute < 0 || attribute >= Attributes::NumberOfAttributes)
|
||||
return 0;
|
||||
|
||||
const ServerObject * object = NULL;
|
||||
const ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return 0;
|
||||
|
||||
jint bonus = 0;
|
||||
if (object->asTangibleObject() != NULL)
|
||||
if (object->asTangibleObject() != nullptr)
|
||||
{
|
||||
bonus = object->asTangibleObject()->getAttribBonus(attribute);
|
||||
}
|
||||
else if (object->asManufactureSchematicObject() != NULL)
|
||||
else if (object->asManufactureSchematicObject() != nullptr)
|
||||
{
|
||||
bonus = object->asManufactureSchematicObject()->getAttribBonus(attribute);
|
||||
}
|
||||
@@ -2271,15 +2271,15 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setAttributeBonus(JNIEnv *env,
|
||||
if (attribute < 0 || attribute >= Attributes::NumberOfAttributes)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
if (object->asTangibleObject() != NULL)
|
||||
if (object->asTangibleObject() != nullptr)
|
||||
{
|
||||
object->asTangibleObject()->setAttribBonus(attribute, bonus);
|
||||
}
|
||||
else if (object->asManufactureSchematicObject() != NULL)
|
||||
else if (object->asManufactureSchematicObject() != nullptr)
|
||||
{
|
||||
object->asManufactureSchematicObject()->setAttribBonus(attribute, bonus);
|
||||
}
|
||||
@@ -2307,7 +2307,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setAttributeBonuses(JNIEnv *env
|
||||
if (bonuses == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2322,13 +2322,13 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setAttributeBonuses(JNIEnv *env
|
||||
jint buffer[Attributes::NumberOfAttributes];
|
||||
env->GetIntArrayRegion(bonuses, 0, count, buffer);
|
||||
|
||||
if (object->asTangibleObject() != NULL)
|
||||
if (object->asTangibleObject() != nullptr)
|
||||
{
|
||||
TangibleObject * tangibleObject = object->asTangibleObject();
|
||||
for (jsize i = 0; i < count; ++i)
|
||||
tangibleObject->setAttribBonus(i, buffer[i]);
|
||||
}
|
||||
else if (object->asManufactureSchematicObject() != NULL)
|
||||
else if (object->asManufactureSchematicObject() != nullptr)
|
||||
{
|
||||
ManufactureSchematicObject * manufactureSchematicObject = object->asManufactureSchematicObject();
|
||||
for (jsize i = 0; i < count; ++i)
|
||||
@@ -2349,13 +2349,13 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setAttributeBonuses(JNIEnv *env
|
||||
* @param self class calling this function
|
||||
* @param target the object
|
||||
*
|
||||
* @return a dictionary of skill mod names -> mod values, or null on error
|
||||
* @return a dictionary of skill mod names -> mod values, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getSkillModBonuses(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return 0;
|
||||
|
||||
@@ -2393,7 +2393,7 @@ jint JNICALL ScriptMethodsCraftingNamespace::getSkillModBonus(JNIEnv *env, jobje
|
||||
|
||||
JavaStringParam jskillMod(skillMod);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return 0;
|
||||
|
||||
@@ -2423,7 +2423,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSkillModBonus(JNIEnv *env, j
|
||||
|
||||
JavaStringParam jskillMod(skillMod);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2452,7 +2452,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSkillModBonuses(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2469,7 +2469,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSkillModBonuses(JNIEnv *env,
|
||||
}
|
||||
|
||||
std::string skillName;
|
||||
const jint * bonusArray = env->GetIntArrayElements(bonus, NULL);
|
||||
const jint * bonusArray = env->GetIntArrayElements(bonus, nullptr);
|
||||
for (int i = 0; i < skillModCount; ++i)
|
||||
{
|
||||
JavaStringParam jskillName(static_cast<jstring>(env->GetObjectArrayElement(skillMod, i)));
|
||||
@@ -2505,7 +2505,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setCategorizedSkillModBonus(JNI
|
||||
JavaStringParam jcategory(category);
|
||||
JavaStringParam jskillMod(skillMod);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2540,7 +2540,7 @@ void JNICALL ScriptMethodsCraftingNamespace::removeCategorizedSkillModBonuses(JN
|
||||
|
||||
JavaStringParam jcategory(category);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return;
|
||||
|
||||
@@ -2566,7 +2566,7 @@ jint JNICALL ScriptMethodsCraftingNamespace::getSkillModSockets(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const TangibleObject * object = NULL;
|
||||
const TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return 0;
|
||||
|
||||
@@ -2589,7 +2589,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSkillModSockets(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * object = NULL;
|
||||
TangibleObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -2610,7 +2610,7 @@ jboolean JNICALL ScriptMethodsCraftingNamespace::setSkillModSockets(JNIEnv *env,
|
||||
* @param qualityPercent % stat adjustment
|
||||
* @param container the container to create the item in
|
||||
*
|
||||
* @return the item, or null on error
|
||||
* @return the item, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobject self, jstring draftSchematic, jfloat qualityPercent, jlong container)
|
||||
{
|
||||
@@ -2618,7 +2618,7 @@ jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobje
|
||||
|
||||
if (draftSchematic == 0 || container == 0)
|
||||
{
|
||||
WARNING(true, ("[script bug] null schematic or container passed to "
|
||||
WARNING(true, ("[script bug] nullptr schematic or container passed to "
|
||||
"makeCraftedItem"));
|
||||
return 0;
|
||||
}
|
||||
@@ -2634,21 +2634,21 @@ jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobje
|
||||
|
||||
const DraftSchematicObject * schematic = DraftSchematicObject::getSchematic(
|
||||
draftSchematicName);
|
||||
if (schematic == NULL)
|
||||
if (schematic == nullptr)
|
||||
{
|
||||
WARNING(true, ("[script bug] bad schematic name %s passed to "
|
||||
"makeCraftedItem", draftSchematicName.c_str()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ServerObject * target = NULL;
|
||||
ServerObject * target = nullptr;
|
||||
if (!JavaLibrary::getObject(container, target))
|
||||
{
|
||||
WARNING(true, ("[script bug] bad container id passed to makeCraftedItem"));
|
||||
return 0;
|
||||
}
|
||||
Object * targetParent = ContainerInterface::getFirstParentInWorld(*target);
|
||||
if (targetParent == NULL)
|
||||
if (targetParent == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::makeCraftedItem can't find parent in world "
|
||||
"for container %s", target->getNetworkId().getValueString().c_str()));
|
||||
@@ -2660,14 +2660,14 @@ jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobje
|
||||
// create a manf schematic and prototype
|
||||
ManufactureSchematicObject * manfSchematic = ServerWorld::createNewManufacturingSchematic(
|
||||
*schematic, createPos, false);
|
||||
if (manfSchematic == NULL)
|
||||
if (manfSchematic == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::makeCraftedItem: error creating manf "
|
||||
"schematic!"));
|
||||
return 0;
|
||||
}
|
||||
ServerObject * prototype = manfSchematic->manufactureObject(createPos);
|
||||
if (prototype == NULL)
|
||||
if (prototype == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::makeCraftedItem: error creating "
|
||||
"prototype!"));
|
||||
@@ -2690,7 +2690,7 @@ jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobje
|
||||
manfSchematic->permanentlyDestroy(DeleteReasons::Consumed);
|
||||
Container::ContainerErrorCode error;
|
||||
if (!ContainerInterface::transferItemToVolumeContainer (*target, *prototype,
|
||||
NULL, error, true))
|
||||
nullptr, error, true))
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::makeCraftedItem: error can't store prototype "
|
||||
"in container, error = %d", error));
|
||||
@@ -2711,14 +2711,14 @@ jlong JNICALL ScriptMethodsCraftingNamespace::makeCraftedItem(JNIEnv *env, jobje
|
||||
* @param self class calling this function
|
||||
* @param manufacturingSchematic the schematic to get the data from
|
||||
*
|
||||
* @return the draft_schematic object, or null on error
|
||||
* @return the draft_schematic object, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicData(JNIEnv *env, jobject self, jlong manufacturingSchematic)
|
||||
{
|
||||
if (manufacturingSchematic == 0)
|
||||
return 0;
|
||||
|
||||
const ManufactureSchematicObject * schematicObject = NULL;
|
||||
const ManufactureSchematicObject * schematicObject = nullptr;
|
||||
if (!JavaLibrary::getObject(manufacturingSchematic, schematicObject))
|
||||
return 0;
|
||||
|
||||
@@ -2735,7 +2735,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getSchematicData(JNIEnv *env, jo
|
||||
* @param self class calling this function
|
||||
* @param draftSchematic the schematic to get the data from
|
||||
*
|
||||
* @return the draft_schematic object, or null on error
|
||||
* @return the draft_schematic object, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicData(JNIEnv *env, jobject self,
|
||||
jstring draftSchematic)
|
||||
@@ -2749,7 +2749,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicData(JNIEnv *en
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * schematicObject = DraftSchematicObject::getSchematic(schematicName);
|
||||
if (schematicObject == NULL)
|
||||
if (schematicObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return JavaLibrary::convert(*schematicObject);
|
||||
@@ -2765,7 +2765,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicData(JNIEnv *en
|
||||
* @param self class calling this function
|
||||
* @param draftSchematicCrc the schematic to get the data from
|
||||
*
|
||||
* @return the draft_schematic object, or null on error
|
||||
* @return the draft_schematic object, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicDataCrc(JNIEnv *env, jobject self,
|
||||
jint draftSchematicCrc)
|
||||
@@ -2774,7 +2774,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicDataCrc(JNIEnv
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * schematicObject = DraftSchematicObject::getSchematic(draftSchematicCrc);
|
||||
if (schematicObject == NULL)
|
||||
if (schematicObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return JavaLibrary::convert(*schematicObject);
|
||||
@@ -2794,7 +2794,7 @@ jobject JNICALL ScriptMethodsCraftingNamespace::getDraftSchematicDataCrc(JNIEnv
|
||||
*/
|
||||
void JNICALL ScriptMethodsCraftingNamespace::recomputeCrateAttributes(JNIEnv *env, jobject self, jlong crate)
|
||||
{
|
||||
FactoryObject * factory = NULL;
|
||||
FactoryObject * factory = nullptr;
|
||||
if (!JavaLibrary::getObject(crate, factory))
|
||||
return;
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ void JNICALL ScriptMethodsDebugNamespace::debugServerConsoleMsg(JNIEnv *env, job
|
||||
ServerObject * object = 0;
|
||||
JavaLibrary::getObject(objId, object);
|
||||
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
{
|
||||
DEBUG_REPORT_LOG(true, ("debugServerConsoleMsg from <unknown>: %s\n",
|
||||
msgString.c_str()));
|
||||
@@ -212,8 +212,8 @@ void JNICALL ScriptMethodsDebugNamespace::debugServerConsoleMsg(JNIEnv *env, job
|
||||
* @param channel the channel to log to
|
||||
* @param msg the message to log
|
||||
* @param logger id of the object where the log is coming from
|
||||
* @param player1 the 1st player for the message (may be null)
|
||||
* @param player2 the 2nd player for the message (may be null)
|
||||
* @param player1 the 1st player for the message (may be nullptr)
|
||||
* @param player2 the 2nd player for the message (may be nullptr)
|
||||
* @param alwaysLog flag to ignore the disableScriptLogs flag and always log this message
|
||||
*/
|
||||
void JNICALL ScriptMethodsDebugNamespace::log(JNIEnv *env, jobject self, jstring channel, jstring msg, jlong logger, jlong player1, jlong player2, jboolean alwaysLog)
|
||||
@@ -222,7 +222,7 @@ void JNICALL ScriptMethodsDebugNamespace::log(JNIEnv *env, jobject self, jstring
|
||||
|
||||
if (channel == 0 || msg == 0)
|
||||
{
|
||||
JavaLibrary::throwInternalScriptError("[designer bug] JavaLibrary::log called with null channel or message");
|
||||
JavaLibrary::throwInternalScriptError("[designer bug] JavaLibrary::log called with nullptr channel or message");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ void JNICALL ScriptMethodsDebugNamespace::log(JNIEnv *env, jobject self, jstring
|
||||
|
||||
if (player1 != 0)
|
||||
{
|
||||
const ServerObject * playerObject = NULL;
|
||||
const ServerObject * playerObject = nullptr;
|
||||
if (JavaLibrary::getObject(player1, playerObject))
|
||||
{
|
||||
std::string::size_type p = msgStr.find("%TU");
|
||||
@@ -264,7 +264,7 @@ void JNICALL ScriptMethodsDebugNamespace::log(JNIEnv *env, jobject self, jstring
|
||||
|
||||
if (player2 != 0)
|
||||
{
|
||||
const ServerObject * playerObject = NULL;
|
||||
const ServerObject * playerObject = nullptr;
|
||||
if (JavaLibrary::getObject(player2, playerObject))
|
||||
{
|
||||
std::string::size_type p = msgStr.find("%TT");
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace NonAuthObjvarNamespace
|
||||
if (!ConfigServerGame::getTrackNonAuthoritativeObjvarSets())
|
||||
return;
|
||||
|
||||
if (name == NULL || *name == '\0')
|
||||
if (name == nullptr || *name == '\0')
|
||||
return;
|
||||
if (obj.isAuthoritative())
|
||||
return;
|
||||
@@ -504,13 +504,13 @@ LocalRefPtr ScriptMethodsDynamicVariableNamespace::convertDynamicVariableListToO
|
||||
* @param buffer a buffer to be filled in with the converted C name
|
||||
* @param bufferSize the length of buffer
|
||||
*
|
||||
* @return the ServerObject * for the obj_id, or null on error
|
||||
* @return the ServerObject * for the obj_id, or nullptr on error
|
||||
*/
|
||||
ServerObject * ScriptMethodsDynamicVariableNamespace::getObjectAndName(JNIEnv *env, jlong objId, jstring name, char * buffer, size_t bufferSize)
|
||||
{
|
||||
NOT_NULL(buffer);
|
||||
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
JavaStringParam localName(name);
|
||||
if (localName.fillBuffer(buffer, bufferSize) > 1)
|
||||
{
|
||||
@@ -523,7 +523,7 @@ ServerObject * ScriptMethodsDynamicVariableNamespace::getObjectAndName(JNIEnv *e
|
||||
{
|
||||
fprintf(stderr, "WARNING: Could not get objvar name\n");
|
||||
}
|
||||
if (object == NULL && !ConfigServerGame::getDisableObjvarNullCheck())
|
||||
if (object == nullptr && !ConfigServerGame::getDisableObjvarNullCheck())
|
||||
JavaLibrary::printJavaStack();
|
||||
|
||||
return object;
|
||||
@@ -540,15 +540,15 @@ ServerObject * ScriptMethodsDynamicVariableNamespace::getObjectAndName(JNIEnv *e
|
||||
* @param buffer a buffer to be filled in with the converted C name
|
||||
* @param bufferSize the length of buffer
|
||||
*
|
||||
* @return the DynamicVariableList * for the obj_id, or null on error
|
||||
* @return the DynamicVariableList * for the obj_id, or nullptr on error
|
||||
*/
|
||||
const DynamicVariableList * ScriptMethodsDynamicVariableNamespace::getObjvarsAndName(JNIEnv *env, jlong objId, jstring name, char * buffer, size_t bufferSize)
|
||||
{
|
||||
NOT_NULL(buffer);
|
||||
|
||||
const DynamicVariableList * objvars = NULL;
|
||||
const DynamicVariableList * objvars = nullptr;
|
||||
const ServerObject * object = getObjectAndName(env, objId, name, buffer, bufferSize);
|
||||
if (object != NULL)
|
||||
if (object != nullptr)
|
||||
{
|
||||
testIsSafeToReadObjvar(*object, buffer);
|
||||
objvars = &object->getObjVars();
|
||||
@@ -582,7 +582,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getDynamicVariable(JNIEnv
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvars = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvars == NULL)
|
||||
if (objvars == nullptr)
|
||||
return 0;
|
||||
const std::string objvarName(buffer);
|
||||
|
||||
@@ -751,7 +751,7 @@ jint JNICALL ScriptMethodsDynamicVariableNamespace::getIntDynamicVariable(JNIEnv
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
int localValue=0;
|
||||
@@ -781,7 +781,7 @@ jintArray JNICALL ScriptMethodsDynamicVariableNamespace::getIntArrayDynamicVaria
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<int> value;
|
||||
@@ -816,7 +816,7 @@ jfloat JNICALL ScriptMethodsDynamicVariableNamespace::getFloatDynamicVariable(JN
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
float localValue = 0;
|
||||
@@ -846,7 +846,7 @@ jfloatArray JNICALL ScriptMethodsDynamicVariableNamespace::getFloatArrayDynamicV
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<real> value;
|
||||
@@ -878,7 +878,7 @@ jstring JNICALL ScriptMethodsDynamicVariableNamespace::getStringDynamicVariable(
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
Unicode::String value;
|
||||
@@ -908,7 +908,7 @@ jobjectArray JNICALL ScriptMethodsDynamicVariableNamespace::getStringArrayDynami
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<Unicode::String> value;
|
||||
@@ -944,7 +944,7 @@ jlong JNICALL ScriptMethodsDynamicVariableNamespace::getObjIdDynamicVariable(JNI
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
NetworkId localValue;
|
||||
@@ -972,7 +972,7 @@ jlongArray JNICALL ScriptMethodsDynamicVariableNamespace::getObjIdArrayDynamicVa
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList *objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<NetworkId> value;
|
||||
@@ -1013,7 +1013,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getLocationDynamicVariabl
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
DynamicVariableLocationData value;
|
||||
@@ -1046,7 +1046,7 @@ jobjectArray JNICALL ScriptMethodsDynamicVariableNamespace::getLocationArrayDyna
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<DynamicVariableLocationData> value;
|
||||
@@ -1092,7 +1092,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getStringIdDynamicVariabl
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
StringId value;
|
||||
@@ -1125,7 +1125,7 @@ jobjectArray JNICALL ScriptMethodsDynamicVariableNamespace::getStringIdArrayDyna
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<StringId> value;
|
||||
@@ -1168,7 +1168,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getTransformDynamicVariab
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
Transform value;
|
||||
@@ -1201,7 +1201,7 @@ jobjectArray JNICALL ScriptMethodsDynamicVariableNamespace::getTransformArrayDyn
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<Transform> value;
|
||||
@@ -1244,7 +1244,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getVectorDynamicVariable(
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
Vector value;
|
||||
@@ -1277,7 +1277,7 @@ jobjectArray JNICALL ScriptMethodsDynamicVariableNamespace::getVectorArrayDynami
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const DynamicVariableList * objvarList = getObjvarsAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return 0;
|
||||
|
||||
std::vector<Vector> value;
|
||||
@@ -1320,7 +1320,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getDynamicVariableList(JN
|
||||
|
||||
JavaStringParam localName(name);
|
||||
|
||||
const ServerObject* object = NULL;
|
||||
const ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(objId, object))
|
||||
return 0;
|
||||
|
||||
@@ -1342,7 +1342,7 @@ jobject JNICALL ScriptMethodsDynamicVariableNamespace::getDynamicVariableList(JN
|
||||
}
|
||||
}
|
||||
|
||||
if (result.get() == NULL)
|
||||
if (result.get() == nullptr)
|
||||
return 0;
|
||||
return result->getReturnValue();
|
||||
} // JavaLibrary::getDynamicVariableList
|
||||
@@ -1364,7 +1364,7 @@ void JNICALL ScriptMethodsDynamicVariableNamespace::removeDynamicVariable(JNIEnv
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return;
|
||||
|
||||
object->removeObjVarItem(buffer);
|
||||
@@ -1384,7 +1384,7 @@ void JNICALL ScriptMethodsDynamicVariableNamespace::removeAllDynamicVariables(JN
|
||||
if (objId == 0)
|
||||
return;
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(objId, object))
|
||||
return;
|
||||
|
||||
@@ -1410,7 +1410,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::hasDynamicVariable(JNIEn
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
const ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return 0;
|
||||
|
||||
const DynamicVariableList &objvarList = object->getObjVars();
|
||||
@@ -1441,11 +1441,11 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setDynamicVariable(JNIEn
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
const DynamicVariableList *objvarList = &(object->getObjVars());
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
// determine what type the data is
|
||||
@@ -1454,9 +1454,9 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setDynamicVariable(JNIEn
|
||||
{
|
||||
// name is the name of an objvar list we will add data to
|
||||
DynamicVariable *objvar = objvarList->getItemByName(localName);
|
||||
if (objvar == NULL)
|
||||
if (objvar == nullptr)
|
||||
objvar = objvarList->addNestedList(localName);
|
||||
if (objvar != NULL && objvar->getType() == DynamicVariable::LIST)
|
||||
if (objvar != nullptr && objvar->getType() == DynamicVariable::LIST)
|
||||
return updateDynamicVariableList(env, *dynamic_cast<DynamicVariableList*>(objvar), data);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -1474,7 +1474,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setDynamicVariable(JNIEn
|
||||
}
|
||||
else if (env->IsInstanceOf(data, ms_clsString) == JNI_TRUE)
|
||||
{
|
||||
if (objvarList->setItem(localName, Unicode::String(env->GetStringChars(static_cast<jstring>(data), NULL))))
|
||||
if (objvarList->setItem(localName, Unicode::String(env->GetStringChars(static_cast<jstring>(data), nullptr))))
|
||||
#error must release characters
|
||||
return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
@@ -1503,7 +1503,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setIntDynamicVariable(JN
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
addSetObjvar(*object, buffer);
|
||||
@@ -1531,7 +1531,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setIntArrayDynamicVariab
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
size_t size = env->GetArrayLength(value);
|
||||
@@ -1574,7 +1574,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setFloatDynamicVariable(
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
addSetObjvar(*object, buffer);
|
||||
@@ -1602,7 +1602,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setFloatArrayDynamicVari
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
size_t size = env->GetArrayLength(value);
|
||||
@@ -1645,7 +1645,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setStringDynamicVariable
|
||||
|
||||
if (name == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("NULL name passed from script to JavaLibrary::setStringDynamicValue"));
|
||||
DEBUG_WARNING(true, ("nullptr name passed from script to JavaLibrary::setStringDynamicValue"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -1653,17 +1653,17 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setStringDynamicVariable
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
if (value == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("NULL string passed from script to JavaLibrary::setStringDynamicValue (%s)",buffer));
|
||||
DEBUG_WARNING(true, ("nullptr string passed from script to JavaLibrary::setStringDynamicValue (%s)",buffer));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
const DynamicVariableList *objvarList = &(object->getObjVars());
|
||||
if (objvarList == NULL)
|
||||
if (objvarList == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
Unicode::String valueString;
|
||||
@@ -1698,7 +1698,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setStringArrayDynamicVar
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<Unicode::String> valueArray;
|
||||
@@ -1754,7 +1754,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setObjIdDynamicVariable(
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
NetworkId oidValue(static_cast<NetworkId::NetworkIdType>
|
||||
@@ -1785,7 +1785,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setObjIdArrayDynamicVari
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<NetworkId> valueArray;
|
||||
@@ -1838,7 +1838,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setLocationDynamicVariab
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
DynamicVariableLocationData locValue;
|
||||
@@ -1878,7 +1878,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setLocationArrayDynamicV
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<DynamicVariableLocationData> valueArray;
|
||||
@@ -1942,7 +1942,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setStringIdDynamicVariab
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
StringId locValue;
|
||||
@@ -1977,7 +1977,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setStringIdArrayDynamicV
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<StringId> valueArray;
|
||||
@@ -2033,7 +2033,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setTransformDynamicVaria
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
Transform locValue;
|
||||
@@ -2068,7 +2068,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setTransformArrayDynamic
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<Transform> valueArray;
|
||||
@@ -2120,7 +2120,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setVectorDynamicVariable
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
Vector locValue;
|
||||
@@ -2155,7 +2155,7 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::setVectorArrayDynamicVar
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
ServerObject * object = getObjectAndName(env, objId, name, buffer, sizeof(buffer));
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<Vector> valueArray;
|
||||
@@ -2227,10 +2227,10 @@ jboolean JNICALL ScriptMethodsDynamicVariableNamespace::copyDynamicVariable(JNIE
|
||||
return JNI_TRUE;
|
||||
|
||||
ServerObject* fromObject = dynamic_cast<ServerObject*>(from.getObject());
|
||||
if (fromObject == NULL)
|
||||
if (fromObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
ServerObject* toObject = dynamic_cast<ServerObject*>(to.getObject());
|
||||
if (toObject == NULL)
|
||||
if (toObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
char buffer[DynamicVariable::MAX_DYNAMIC_VARIABLE_NAME_LEN];
|
||||
|
||||
@@ -48,7 +48,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
jboolean JNICALL ScriptMethodsFormNamespace::editFormData(JNIEnv * env, jobject self, jlong player, jlong jObjectToEdit, jobjectArray jKeys, jobjectArray jValues)
|
||||
{
|
||||
UNREF(self);
|
||||
ServerObject * playerServerObject = NULL;
|
||||
ServerObject * playerServerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerServerObject) || !playerServerObject)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("[script bug] can't get player in editFormData"));
|
||||
@@ -62,7 +62,7 @@ jboolean JNICALL ScriptMethodsFormNamespace::editFormData(JNIEnv * env, jobject
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
ServerObject * objectToEditServerObject = NULL;
|
||||
ServerObject * objectToEditServerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(jObjectToEdit, objectToEditServerObject) || !objectToEditServerObject)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("[script bug] objectToEdit is not a ServerObject in editFormData"));
|
||||
|
||||
@@ -90,7 +90,7 @@ void JNICALL ScriptMethodsHateListNamespace::setAggroImmuneDuration(JNIEnv * /*e
|
||||
NetworkId const playerNetworkId(player);
|
||||
PlayerObject * const playerObject = PlayerCreatureController::getPlayerObject(CreatureObject::getCreatureObject(playerNetworkId));
|
||||
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::setAggroImmuneDuration() player(%s) Unable to resolve the object to a PlayerObject.", playerNetworkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -105,7 +105,7 @@ jboolean JNICALL ScriptMethodsHateListNamespace::isAggroImmune(JNIEnv * /*env*/,
|
||||
NetworkId const playerNetworkId(player);
|
||||
PlayerObject * const playerObject = PlayerCreatureController::getPlayerObject(CreatureObject::getCreatureObject(playerNetworkId));
|
||||
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void JNICALL ScriptMethodsHateListNamespace::addHate(JNIEnv * /*env*/, jobject /
|
||||
NetworkId const hateTargetNetworkId(hateTarget);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::addHate() object(%s) hateTarget(%s) hate(%.2f) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str(), hate));
|
||||
return;
|
||||
@@ -148,7 +148,7 @@ void JNICALL ScriptMethodsHateListNamespace::addHateDot(JNIEnv * /*env*/, jobjec
|
||||
NetworkId const hateTargetNetworkId(hateTarget);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::addHateDot() object(%s) hateTarget(%s) hate(%.2f) seconds(%d) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str(), hate, seconds));
|
||||
return;
|
||||
@@ -178,7 +178,7 @@ void JNICALL ScriptMethodsHateListNamespace::setHate(JNIEnv * /*env*/, jobject /
|
||||
NetworkId const hateTargetNetworkId(hateTarget);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("ScriptMethodsHateList::setHate() object(%s) hateTarget(%s) hate(%.2f) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str(), hate));
|
||||
return;
|
||||
@@ -208,7 +208,7 @@ void JNICALL ScriptMethodsHateListNamespace::removeHateTarget(JNIEnv * /*env*/,
|
||||
NetworkId const hateTargetNetworkId(hateTarget);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("ScriptMethodsHateList::removeHateTarget() object(%s) hateTarget(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -238,7 +238,7 @@ jfloat JNICALL ScriptMethodsHateListNamespace::getHate(JNIEnv * /*env*/, jobject
|
||||
NetworkId const hateTargetNetworkId(hateTarget);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::getHate() object(%s) hateTarget(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str()));
|
||||
return 0.0f;
|
||||
@@ -264,7 +264,7 @@ jfloat JNICALL ScriptMethodsHateListNamespace::getMaxHate(JNIEnv * /*env*/, jobj
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::getMaxHate() object(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str()));
|
||||
return 0.0f;
|
||||
@@ -281,7 +281,7 @@ void JNICALL ScriptMethodsHateListNamespace::clearHateList(JNIEnv * /*env*/, job
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::clearHateList() Unable to resolve the object(%s) to a TangibleObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -298,7 +298,7 @@ jlong JNICALL ScriptMethodsHateListNamespace::getHateTarget(JNIEnv * /*env*/, jo
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::getHateTarget() Unable to resolve the object(%s) to a TangibleObject.", networkId.getValueString().c_str()));
|
||||
return 0;
|
||||
@@ -317,7 +317,7 @@ jlongArray JNICALL ScriptMethodsHateListNamespace::getHateList(JNIEnv * /*env*/,
|
||||
|
||||
LOGC(AiLogManager::isLogging(networkId), "debug_ai", ("ScriptMethodsHateList::getHateList() object(%s)", networkId.getValueString().c_str()));
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::getHateList() Unable to resolve the object(%s) to a TangibleObject.", networkId.getValueString().c_str()));
|
||||
return 0;
|
||||
@@ -348,7 +348,7 @@ jboolean JNICALL ScriptMethodsHateListNamespace::isOnHateList(JNIEnv * /*env*/,
|
||||
NetworkId const targetNetworkId(target);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::isOnHateList() object(%s) target(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), targetNetworkId.getValueString().c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -369,7 +369,7 @@ void JNICALL ScriptMethodsHateListNamespace::resetHateTimer(JNIEnv * /*env*/, jo
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::resetHateTimer() object(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -385,7 +385,7 @@ void JNICALL ScriptMethodsHateListNamespace::setAILeashTime(JNIEnv * /*env*/, jo
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::setAILeashTime() object(%s) time(%.2f) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), time));
|
||||
return;
|
||||
@@ -408,7 +408,7 @@ jfloat JNICALL ScriptMethodsHateListNamespace::getAILeashTime(JNIEnv * /*env*/,
|
||||
NetworkId const networkId(object);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsHateList::setAILeashTime() object(%s) time(%.2f) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), time));
|
||||
return 0.0;
|
||||
@@ -434,7 +434,7 @@ void JNICALL ScriptMethodsHateListNamespace::forceHateTarget(JNIEnv * env, jobje
|
||||
NetworkId const hateTargetNetworkId(target);
|
||||
TangibleObject * const objectTangibleObject = TangibleObject::getTangibleObject(networkId);
|
||||
|
||||
if (objectTangibleObject == NULL)
|
||||
if (objectTangibleObject == nullptr)
|
||||
{
|
||||
WARNING(true, ("ScriptMethodsHateList::forceHateTarget() object(%s) hateTarget(%s) Unable to resolve the object to a TangibleObject.", networkId.getValueString().c_str(), hateTargetNetworkId.getValueString().c_str()));
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,7 @@ jboolean JNICALL ScriptMethodsHolocubeNamespace::openHolocronToPage(JNIEnv *env,
|
||||
{
|
||||
JavaStringParam localPage(jpage);
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
{
|
||||
WARNING (true, ("[Script bug] Could not get ServerObject for value passed in for paramter:client in JavaLibrary::openHolocronToPage"));
|
||||
@@ -76,7 +76,7 @@ jboolean JNICALL ScriptMethodsHolocubeNamespace::openHolocronToPage(JNIEnv *env,
|
||||
|
||||
jboolean JNICALL ScriptMethodsHolocubeNamespace::closeHolocron(JNIEnv *env, jobject self, jlong client)
|
||||
{
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
{
|
||||
WARNING (true, ("[Script bug] Could not get ServerObject for value passed in for paramter:client in JavaLibrary::closeHolocron"));
|
||||
|
||||
@@ -131,10 +131,10 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePlayerToLocation(JNIEnv
|
||||
|
||||
// Make sure the ship is not docking
|
||||
|
||||
Controller const * const controller = (shipObject != NULL) ? shipObject->getController() : NULL;
|
||||
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
|
||||
Controller const * const controller = (shipObject != nullptr) ? shipObject->getController() : nullptr;
|
||||
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
|
||||
|
||||
if ( (shipController != NULL)
|
||||
if ( (shipController != nullptr)
|
||||
&& shipController->isDocking())
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToLocation - Hyperspacing is not allowed on ships that are currently docking: %s", shipObject->getDebugInformation().c_str()));
|
||||
@@ -211,10 +211,10 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePlayerToLocationCellNam
|
||||
|
||||
// Make sure the ship is not docking
|
||||
|
||||
Controller const * const controller = (shipObject != NULL) ? shipObject->getController() : NULL;
|
||||
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
|
||||
Controller const * const controller = (shipObject != nullptr) ? shipObject->getController() : nullptr;
|
||||
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
|
||||
|
||||
if ( (shipController != NULL)
|
||||
if ( (shipController != nullptr)
|
||||
&& shipController->isDocking())
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToLocation - Hyperspacing is not allowed on ships that are currently docking: %s", shipObject->getDebugInformation().c_str()));
|
||||
@@ -272,7 +272,7 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePlayerToHyperspacePoint
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : NULL;
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : nullptr;
|
||||
if(!playerCreature)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToHyperspacePoint - player is not a creature"));
|
||||
@@ -309,10 +309,10 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePlayerToHyperspacePoint
|
||||
|
||||
// Make sure the ship is not docking
|
||||
|
||||
Controller const * const controller = (shipObject != NULL) ? shipObject->getController() : NULL;
|
||||
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
|
||||
Controller const * const controller = (shipObject != nullptr) ? shipObject->getController() : nullptr;
|
||||
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
|
||||
|
||||
if ( (shipController != NULL)
|
||||
if ( (shipController != nullptr)
|
||||
&& shipController->isDocking())
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToHyperspacePoint - Hyperspacing is not allowed on ships that are currently docking: %s", shipObject->getDebugInformation().c_str()));
|
||||
@@ -395,7 +395,7 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePrepareShipOnClient(JNI
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : NULL;
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : nullptr;
|
||||
if(playerCreature == 0)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToHyperspacePoint - player is not a creature"));
|
||||
@@ -425,8 +425,8 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspacePrepareShipOnClient(JNI
|
||||
|
||||
if (HyperspaceManager::getHyperspacePoint(hyperspacePoint, location))
|
||||
{
|
||||
Controller const * const controller = (shipObject != NULL) ? shipObject->getController() : NULL;
|
||||
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
|
||||
Controller const * const controller = (shipObject != nullptr) ? shipObject->getController() : nullptr;
|
||||
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
|
||||
|
||||
if (shipController != 0)
|
||||
{
|
||||
@@ -467,7 +467,7 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspaceRestoreShipOnClientFrom
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : NULL;
|
||||
CreatureObject * const playerCreature = playerObject ? playerObject->asCreatureObject() : nullptr;
|
||||
if(playerCreature == 0)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("hyperspacePlayerToHyperspacePoint - player is not a creature"));
|
||||
@@ -482,8 +482,8 @@ void JNICALL ScriptMethodsHyperspaceNamespace::hyperspaceRestoreShipOnClientFrom
|
||||
return;
|
||||
}
|
||||
|
||||
Controller const * const controller = (shipObject != NULL) ? shipObject->getController() : NULL;
|
||||
ShipController const * const shipController = (controller != NULL) ? controller->asShipController() : NULL;
|
||||
Controller const * const controller = (shipObject != nullptr) ? shipObject->getController() : nullptr;
|
||||
ShipController const * const shipController = (controller != nullptr) ? controller->asShipController() : nullptr;
|
||||
|
||||
if (shipController != 0)
|
||||
{
|
||||
@@ -514,7 +514,7 @@ jstring JNICALL ScriptMethodsHyperspaceNamespace::getSceneForHyperspacePoint(JNI
|
||||
if (!JavaLibrary::convert(localHyperspacePoint, hyperspacePoint))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("getSceneForHyperspacePoint - could not get hyperspace point name"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(HyperspaceManager::isValidHyperspacePoint(hyperspacePoint))
|
||||
@@ -528,7 +528,7 @@ jstring JNICALL ScriptMethodsHyperspaceNamespace::getSceneForHyperspacePoint(JNI
|
||||
return str.getReturnValue();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -70,7 +70,7 @@ void JNICALL ScriptMethodsImageDesignNamespace::imagedesignStart(JNIEnv *env, jo
|
||||
return;
|
||||
}
|
||||
|
||||
//the terminal can be NULL (that means no ID terminal is being used, which is fine)
|
||||
//the terminal can be nullptr (that means no ID terminal is being used, which is fine)
|
||||
ServerObject * terminalObj = 0;
|
||||
JavaLibrary::getObject(jterminalId, terminalObj);
|
||||
|
||||
@@ -185,8 +185,8 @@ jboolean JNICALL ScriptMethodsImageDesignNamespace::imagedesignValidated(JNIEnv
|
||||
WARNING(true, ("morph keys and values arrays are of diffent sizes"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
jfloat * const morphChangesValuesArray = env->GetFloatArrayElements(jmorphChangesValues, NULL);
|
||||
if (morphChangesValuesArray == NULL)
|
||||
jfloat * const morphChangesValuesArray = env->GetFloatArrayElements(jmorphChangesValues, nullptr);
|
||||
if (morphChangesValuesArray == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@@ -211,8 +211,8 @@ jboolean JNICALL ScriptMethodsImageDesignNamespace::imagedesignValidated(JNIEnv
|
||||
WARNING(true, ("index keys and values arrays are of diffent sizes"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
jint * const indexChangesValuesArray = env->GetIntArrayElements(jindexChangesValues, NULL);
|
||||
if (indexChangesValuesArray == NULL)
|
||||
jint * const indexChangesValuesArray = env->GetIntArrayElements(jindexChangesValues, nullptr);
|
||||
if (indexChangesValuesArray == nullptr)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ void JNICALL ScriptMethodsInstallationNamespace::displayStructurePermissionData(
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
CreatureObject* creatureObject = NULL;
|
||||
CreatureObject* creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject))
|
||||
return;
|
||||
|
||||
@@ -290,7 +290,7 @@ jfloat JNICALL ScriptMethodsInstallationNamespace::getPowerValue(JNIEnv *env, jo
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
const InstallationObject * installation = NULL;
|
||||
const InstallationObject * installation = nullptr;
|
||||
if (!JavaLibrary::getObject(target, installation))
|
||||
return 0;
|
||||
|
||||
@@ -314,7 +314,7 @@ jboolean JNICALL ScriptMethodsInstallationNamespace::setPowerValue(JNIEnv *env,
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
InstallationObject * installation = NULL;
|
||||
InstallationObject * installation = nullptr;
|
||||
if (!JavaLibrary::getObject(target, installation))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -340,7 +340,7 @@ jboolean JNICALL ScriptMethodsInstallationNamespace::incrementPowerValue(JNIEnv
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
InstallationObject * installation = NULL;
|
||||
InstallationObject * installation = nullptr;
|
||||
if (!JavaLibrary::getObject(target, installation))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -365,7 +365,7 @@ jfloat JNICALL ScriptMethodsInstallationNamespace::getPowerRate(JNIEnv *env, job
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
const InstallationObject * installation = NULL;
|
||||
const InstallationObject * installation = nullptr;
|
||||
if (!JavaLibrary::getObject(target, installation))
|
||||
return 0;
|
||||
|
||||
@@ -389,7 +389,7 @@ jboolean JNICALL ScriptMethodsInstallationNamespace::setPowerRate(JNIEnv *env, j
|
||||
UNREF(self);
|
||||
|
||||
//get the player id from player
|
||||
InstallationObject * installation = NULL;
|
||||
InstallationObject * installation = nullptr;
|
||||
if (!JavaLibrary::getObject(target, installation))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::createObjectInCell(JNIEnv *env, j
|
||||
return 0;
|
||||
|
||||
std::string templateName;
|
||||
ServerObject* sourceObject = NULL;
|
||||
ServerObject* sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
return 0;
|
||||
templateName = sourceObject->getTemplateName();
|
||||
@@ -149,7 +149,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::_createObjectInCellInternal(JNIEn
|
||||
{
|
||||
JavaStringParam localCellName(cellName);
|
||||
|
||||
ServerObject * portallizedObject = NULL;
|
||||
ServerObject * portallizedObject = nullptr;
|
||||
if (!JavaLibrary::getObject(building, portallizedObject))
|
||||
return 0;
|
||||
|
||||
@@ -183,7 +183,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::_createObjectInCellInternal(JNIEn
|
||||
Transform tr;
|
||||
tr.setPosition_p(newPos);
|
||||
ServerObject *newObject = ServerWorld::createNewObject(templateName, tr, cellObject, false);
|
||||
if (newObject == NULL)
|
||||
if (newObject == nullptr)
|
||||
return 0;
|
||||
|
||||
//@todo do we need to snap to floor or something?
|
||||
@@ -226,7 +226,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::createObjectInCellAnywhere(JNIEnv
|
||||
return 0;
|
||||
|
||||
std::string templateName;
|
||||
ServerObject* sourceObject = NULL;
|
||||
ServerObject* sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
return 0;
|
||||
templateName = sourceObject->getTemplateName();
|
||||
@@ -261,7 +261,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::_createObjectInCellAnywhereIntern
|
||||
//@todo need to find a way to get a good location in a cell. For now just use the coordinates of the cell?
|
||||
JavaStringParam localCellName(cellName);
|
||||
|
||||
ServerObject *portallizedObject = NULL;
|
||||
ServerObject *portallizedObject = nullptr;
|
||||
if (!JavaLibrary::getObject(building, portallizedObject))
|
||||
return 0;
|
||||
|
||||
@@ -289,7 +289,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::_createObjectInCellAnywhereIntern
|
||||
Transform tr;
|
||||
tr.setPosition_p(createPosition);
|
||||
ServerObject *newObject = ServerWorld::createNewObject(templateName, tr, cellObject, false);
|
||||
if (newObject == NULL)
|
||||
if (newObject == nullptr)
|
||||
return 0;
|
||||
|
||||
// create an networkId to return
|
||||
@@ -306,7 +306,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::_createObjectInCellAnywhereIntern
|
||||
|
||||
jobjectArray JNICALL ScriptMethodsInteriorsNamespace::getCellNames(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
ServerObject const *portallizedObject = NULL;
|
||||
ServerObject const *portallizedObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, portallizedObject))
|
||||
return 0;
|
||||
|
||||
@@ -329,7 +329,7 @@ jobjectArray JNICALL ScriptMethodsInteriorsNamespace::getCellNames(JNIEnv *env,
|
||||
|
||||
jstring JNICALL ScriptMethodsInteriorsNamespace::getCellName(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
CellObject const *cellObject = NULL;
|
||||
CellObject const *cellObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, cellObject))
|
||||
return 0;
|
||||
|
||||
@@ -342,7 +342,7 @@ jstring JNICALL ScriptMethodsInteriorsNamespace::getCellName(JNIEnv *env, jobjec
|
||||
}
|
||||
|
||||
ServerObject const * const portallizedObject = safe_cast<ServerObject const *>(ContainerInterface::getContainedByObject(*cellObject));
|
||||
if (portallizedObject == NULL)
|
||||
if (portallizedObject == nullptr)
|
||||
return 0;
|
||||
|
||||
PortalProperty const * const cellProp = portallizedObject->getPortalProperty();
|
||||
@@ -370,7 +370,7 @@ jstring JNICALL ScriptMethodsInteriorsNamespace::getCellName(JNIEnv *env, jobjec
|
||||
|
||||
jlongArray JNICALL ScriptMethodsInteriorsNamespace::getCellIds(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
ServerObject const *portallizedObject = NULL;
|
||||
ServerObject const *portallizedObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, portallizedObject))
|
||||
return 0;
|
||||
|
||||
@@ -387,11 +387,11 @@ jlongArray JNICALL ScriptMethodsInteriorsNamespace::getCellIds(JNIEnv *env, jobj
|
||||
cellIds.reserve(count);
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
ServerObject const * cellObject = NULL;
|
||||
ServerObject const * cellObject = nullptr;
|
||||
CellProperty const * const cellProp = portalProp->getCell(nameList[i]);
|
||||
if (cellProp != NULL)
|
||||
if (cellProp != nullptr)
|
||||
cellObject = cellProp->getOwner().asServerObject();
|
||||
if (cellObject != NULL)
|
||||
if (cellObject != nullptr)
|
||||
{
|
||||
cellIds.push_back(cellObject->getNetworkId());
|
||||
}
|
||||
@@ -412,7 +412,7 @@ jboolean JNICALL ScriptMethodsInteriorsNamespace::hasCell(JNIEnv *env, jobject s
|
||||
{
|
||||
JavaStringParam localCellName(cellName);
|
||||
|
||||
ServerObject const * serverObject = NULL;
|
||||
ServerObject const * serverObject = nullptr;
|
||||
if (!JavaLibrary::getObject(portallizedObject, serverObject))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::hasCell passed invalid object"));
|
||||
@@ -448,7 +448,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::getCellId(JNIEnv *env, jobject se
|
||||
{
|
||||
JavaStringParam localCellName(cellName);
|
||||
|
||||
ServerObject const * serverObject = NULL;
|
||||
ServerObject const * serverObject = nullptr;
|
||||
if (!JavaLibrary::getObject(portallizedObject, serverObject))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("[script bug] JavaLibrary::getCellId passed invalid object"));
|
||||
@@ -571,7 +571,7 @@ jobject JNICALL ScriptMethodsInteriorsNamespace::getBuildingEjectLocation(JNIEnv
|
||||
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getBuildingEjectLocation was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getBuildingEjectLocation was passed a nullptr building objid"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ jobject JNICALL ScriptMethodsInteriorsNamespace::getBuildingEjectLocation(JNIEnv
|
||||
CellProperty const *worldCell = CellProperty::getWorldCellProperty();
|
||||
if (!worldCell)
|
||||
{
|
||||
DEBUG_WARNING(true, ("getBuildingEjectLocation get a NULL worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
DEBUG_WARNING(true, ("getBuildingEjectLocation get a nullptr worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::moveHouseItemToPlayer(JNIEnv * /*
|
||||
{
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] moveHouseItemToPlayer was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] moveHouseItemToPlayer was passed a nullptr building objid"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ jlong JNICALL ScriptMethodsInteriorsNamespace::moveHouseItemToPlayer2(JNIEnv * /
|
||||
{
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] moveHouseItemToPlayer2 was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] moveHouseItemToPlayer2 was passed a nullptr building objid"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -721,7 +721,7 @@ void JNICALL ScriptMethodsInteriorsNamespace::deleteAllHouseItems(JNIEnv * /*env
|
||||
{
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] deleteAllHouseItems was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] deleteAllHouseItems was passed a nullptr building objid"));
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -747,11 +747,11 @@ jboolean JNICALL ScriptMethodsInteriorsNamespace::areAllContentsLoaded(JNIEnv *
|
||||
{
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] areAllContentsLoaded was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] areAllContentsLoaded was passed a nullptr building objid"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
const BuildingObject * buildingObject = NULL;
|
||||
const BuildingObject * buildingObject = nullptr;
|
||||
if (!JavaLibrary::getObject(building, buildingObject))
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] areAllContentsLoaded was passed a non-ServerObject objid"));
|
||||
@@ -767,11 +767,11 @@ void JNICALL ScriptMethodsInteriorsNamespace::loadBuildingContents(JNIEnv * /*en
|
||||
{
|
||||
if (building == 0)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] loadBuildingContents was passed a NULL building objid"));
|
||||
DEBUG_WARNING(true, ("[designer bug] loadBuildingContents was passed a nullptr building objid"));
|
||||
return;
|
||||
}
|
||||
|
||||
BuildingObject * buildingObject = NULL;
|
||||
BuildingObject * buildingObject = nullptr;
|
||||
if (!JavaLibrary::getObject(building, buildingObject))
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] loadBuildingContents was passed a non-ServerObject objid"));
|
||||
@@ -815,9 +815,9 @@ jboolean JNICALL ScriptMethodsInteriorsNamespace::isAtPendingLoadRequestLimit(JN
|
||||
|
||||
jstring JNICALL ScriptMethodsInteriorsNamespace::getCellLabel(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
CellObject const *cellObject = NULL;
|
||||
CellObject const *cellObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, cellObject))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
JavaString cellLabel(cellObject->getCellLabel());
|
||||
return cellLabel.getReturnValue();
|
||||
@@ -833,7 +833,7 @@ jboolean JNICALL ScriptMethodsInteriorsNamespace::setCellLabel(JNIEnv * env, job
|
||||
if (!JavaLibrary::convert(localCellLabel, cellLabelString))
|
||||
return JNI_FALSE;
|
||||
|
||||
CellObject * cellObject = NULL;
|
||||
CellObject * cellObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, cellObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -846,7 +846,7 @@ jboolean JNICALL ScriptMethodsInteriorsNamespace::setCellLabel(JNIEnv * env, job
|
||||
|
||||
jboolean JNICALL ScriptMethodsInteriorsNamespace::setCellLabelOffset(JNIEnv * env, jobject self, jlong target, jfloat x, jfloat y, jfloat z)
|
||||
{
|
||||
CellObject * cellObject = NULL;
|
||||
CellObject * cellObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, cellObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ jint JNICALL ScriptMethodsJediNamespace::getMaxForcePower(JNIEnv *env, jobject s
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return 0;
|
||||
|
||||
@@ -128,7 +128,7 @@ jint JNICALL ScriptMethodsJediNamespace::getMaxForcePower(JNIEnv *env, jobject s
|
||||
return 0;
|
||||
|
||||
PlayerObject const * const playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return playerObject->getMaxForcePower();
|
||||
@@ -148,7 +148,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setMaxForcePower(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -159,7 +159,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setMaxForcePower(JNIEnv *env, jobje
|
||||
}
|
||||
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
playerObject->setMaxForcePower(value);
|
||||
@@ -180,7 +180,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::alterMaxForcePower(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -191,7 +191,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::alterMaxForcePower(JNIEnv *env, job
|
||||
}
|
||||
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
playerObject->setMaxForcePower(playerObject->getMaxForcePower() + delta);
|
||||
@@ -211,7 +211,7 @@ jint JNICALL ScriptMethodsJediNamespace::getForcePower(JNIEnv *env, jobject self
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return 0;
|
||||
|
||||
@@ -219,7 +219,7 @@ jint JNICALL ScriptMethodsJediNamespace::getForcePower(JNIEnv *env, jobject self
|
||||
return 0;
|
||||
|
||||
PlayerObject const * const playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return playerObject->getForcePower();
|
||||
@@ -239,7 +239,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setForcePower(JNIEnv *env, jobject
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -250,7 +250,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setForcePower(JNIEnv *env, jobject
|
||||
}
|
||||
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
playerObject->setForcePower(value);
|
||||
@@ -271,7 +271,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::alterForcePower(JNIEnv *env, jobjec
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -282,7 +282,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::alterForcePower(JNIEnv *env, jobjec
|
||||
}
|
||||
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
playerObject->setForcePower(playerObject->getForcePower() + delta);
|
||||
@@ -302,7 +302,7 @@ jfloat JNICALL ScriptMethodsJediNamespace::getForcePowerRegenRate(JNIEnv *env, j
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return 0;
|
||||
|
||||
@@ -310,7 +310,7 @@ jfloat JNICALL ScriptMethodsJediNamespace::getForcePowerRegenRate(JNIEnv *env, j
|
||||
return 0;
|
||||
|
||||
PlayerObject const * const playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return playerObject->getForcePowerRegenRate();
|
||||
@@ -330,7 +330,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setForcePowerRegenRate(JNIEnv *env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -341,7 +341,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setForcePowerRegenRate(JNIEnv *env,
|
||||
}
|
||||
|
||||
PlayerObject * playerObject = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (playerObject == NULL)
|
||||
if (playerObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
playerObject->setForcePowerRegenRate(rate);
|
||||
@@ -359,7 +359,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setForcePowerRegenRate(JNIEnv *env,
|
||||
*/
|
||||
jint JNICALL ScriptMethodsJediNamespace::getJediState(JNIEnv *env, jobject self, jlong jedi)
|
||||
{
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(jedi, object))
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getJediState did not find creature for id passed in"));
|
||||
@@ -367,7 +367,7 @@ jint JNICALL ScriptMethodsJediNamespace::getJediState(JNIEnv *env, jobject self,
|
||||
}
|
||||
|
||||
const SwgPlayerObject * player = safe_cast<const SwgPlayerObject *>(PlayerCreatureController::getPlayerObject(object));
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getJediState did not find player for creature "
|
||||
"%s", object->getNetworkId().getValueString().c_str()));
|
||||
@@ -389,12 +389,12 @@ jint JNICALL ScriptMethodsJediNamespace::getJediState(JNIEnv *env, jobject self,
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsJediNamespace::setJediState(JNIEnv *env, jobject self, jlong jedi, jint state)
|
||||
{
|
||||
CreatureObject * object = NULL;
|
||||
CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(jedi, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
SwgPlayerObject * const player = safe_cast<SwgPlayerObject *>(PlayerCreatureController::getPlayerObject(object));
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
if (state == JS_none ||
|
||||
@@ -424,7 +424,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setJediState(JNIEnv *env, jobject s
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsJediNamespace::hasJediSlot(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
const ServerObject * player = NULL;
|
||||
const ServerObject * player = nullptr;
|
||||
if (!JavaLibrary::getObject(target, player))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -444,12 +444,12 @@ jboolean JNICALL ScriptMethodsJediNamespace::hasJediSlot(JNIEnv * env, jobject s
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsJediNamespace::addJediSlot(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject const * const player = PlayerCreatureController::getPlayerObject(object);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
player->addJediToAccount();
|
||||
@@ -475,12 +475,12 @@ jboolean JNICALL ScriptMethodsJediNamespace::isJedi(JNIEnv * env, jobject self,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
const PlayerObject * player = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
const SwgPlayerObject * jedi = safe_cast<const SwgPlayerObject *>(player);
|
||||
|
||||
@@ -502,12 +502,12 @@ jint JNICALL ScriptMethodsJediNamespace::getJediVisibility(JNIEnv * env, jobject
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return -1;
|
||||
|
||||
const PlayerObject * player = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
const SwgPlayerObject * jedi = safe_cast<const SwgPlayerObject *>(player);
|
||||
|
||||
@@ -531,12 +531,12 @@ jboolean JNICALL ScriptMethodsJediNamespace::setJediVisibility(JNIEnv * env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject * player = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
SwgPlayerObject * jedi = safe_cast<SwgPlayerObject *>(player);
|
||||
|
||||
@@ -561,12 +561,12 @@ jboolean JNICALL ScriptMethodsJediNamespace::changeJediVisibility(JNIEnv * env,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject * player = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
SwgPlayerObject * jedi = safe_cast<SwgPlayerObject *>(player);
|
||||
|
||||
@@ -591,19 +591,19 @@ jboolean JNICALL ScriptMethodsJediNamespace::setJediBountyValue(JNIEnv * env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
SwgCreatureObject const * jediCreature = safe_cast<SwgCreatureObject const *>(creature);
|
||||
|
||||
PlayerObject const * player = PlayerCreatureController::getPlayerObject(creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
SwgPlayerObject const * jediPlayer = safe_cast<SwgPlayerObject const *>(player);
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
jediManager->addJedi(creature->getNetworkId(), creature->getObjectName(),
|
||||
@@ -631,7 +631,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::setJediBountyValue(JNIEnv * env, jo
|
||||
* @param bounties limit for number of bounties on the Jedi statistic
|
||||
* @param state what state(s) the Jedi should have
|
||||
*
|
||||
* @return a dictionary with the Jedi data on success, null on error
|
||||
* @return a dictionary with the Jedi data on success, nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsJediNamespace::requestJedi(JNIEnv * env, jobject self, jint visibility,
|
||||
jint bountyValue, jint minLevel, jint maxLevel, jint hoursAlive, jint bounties, jint state)
|
||||
@@ -640,7 +640,7 @@ jobject JNICALL ScriptMethodsJediNamespace::requestJedi(JNIEnv * env, jobject se
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return 0;
|
||||
|
||||
ScriptParams params;
|
||||
@@ -658,7 +658,7 @@ jobject JNICALL ScriptMethodsJediNamespace::requestJedi(JNIEnv * env, jobject se
|
||||
* @param self class calling this function
|
||||
* @param target the id of the Jedi
|
||||
*
|
||||
* @return a dictionary with the Jedi data on success, null on error
|
||||
* @return a dictionary with the Jedi data on success, nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsJediNamespace::requestOneJedi(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
@@ -666,7 +666,7 @@ jobject JNICALL ScriptMethodsJediNamespace::requestOneJedi(JNIEnv * env, jobject
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return 0;
|
||||
|
||||
const NetworkId id(target);
|
||||
@@ -704,7 +704,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::requestJediBounty(JNIEnv * env, job
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -751,7 +751,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::removeJediBounty(JNIEnv * env, jobj
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -781,7 +781,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::removeAllJediBounties(JNIEnv * env,
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -799,7 +799,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::removeAllJediBounties(JNIEnv * env,
|
||||
* @param self class calling this function
|
||||
* @param target the Jedi
|
||||
*
|
||||
* @return an array of hunter ids, or null on error
|
||||
* @return an array of hunter ids, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsJediNamespace::getJediBounties(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
@@ -807,7 +807,7 @@ jlongArray JNICALL ScriptMethodsJediNamespace::getJediBounties(JNIEnv * env, job
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return 0;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -837,7 +837,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::isBeingHuntedByBountyHunter(JNIEnv
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -861,7 +861,7 @@ jboolean JNICALL ScriptMethodsJediNamespace::isBeingHuntedByBountyHunter(JNIEnv
|
||||
* @param self class calling this function
|
||||
* @param hunter the bounty hunter
|
||||
*
|
||||
* @return an array of jedi ids, or null on error
|
||||
* @return an array of jedi ids, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsJediNamespace::getBountyHunterBounties(JNIEnv * env, jobject self, jlong hunter)
|
||||
{
|
||||
@@ -869,7 +869,7 @@ jlongArray JNICALL ScriptMethodsJediNamespace::getBountyHunterBounties(JNIEnv *
|
||||
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return 0;
|
||||
|
||||
const NetworkId hunterId(hunter);
|
||||
@@ -899,7 +899,7 @@ void JNICALL ScriptMethodsJediNamespace::updateJediScriptData(JNIEnv * env, jobj
|
||||
{
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
@@ -926,7 +926,7 @@ void JNICALL ScriptMethodsJediNamespace::removeJediScriptData(JNIEnv * env, jobj
|
||||
{
|
||||
JediManagerObject * jediManager = static_cast<SwgServerUniverse &>(
|
||||
ServerUniverse::getInstance()).getJediManager();
|
||||
if (jediManager == NULL)
|
||||
if (jediManager == nullptr)
|
||||
return;
|
||||
|
||||
const NetworkId targetId(target);
|
||||
|
||||
@@ -253,7 +253,7 @@ jobjectArray JNICALL ScriptMethodsMapNamespace::getPlanetaryMapLocations(
|
||||
if(!JavaLibrary::convert(localCategory, categoryName))
|
||||
{
|
||||
DEBUG_WARNING(true, ("[script bug] invalid category passed to getPlanetaryMapLocations"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ jobjectArray JNICALL ScriptMethodsMapNamespace::getPlanetaryMapLocations(
|
||||
if(!JavaLibrary::convert(localSubCategory, subCategoryName))
|
||||
{
|
||||
DEBUG_WARNING(true, ("[script bug] invalid SubCategory passed to getPlanetaryMapLocations"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,12 +282,12 @@ jobjectArray JNICALL ScriptMethodsMapNamespace::getPlanetaryMapLocations(
|
||||
|
||||
jlong jLocationId = mapLocation.getLocationId().getValue();
|
||||
if (!jLocationId)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
JavaString jNameString(mapLocation.getLocationName());
|
||||
|
||||
if (jNameString.getValue() == 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalRefPtr jMapLocation = createNewObject(JavaLibrary::getClsMapLocation(),
|
||||
JavaLibrary::getMidMapLocation(),
|
||||
@@ -299,7 +299,7 @@ jobjectArray JNICALL ScriptMethodsMapNamespace::getPlanetaryMapLocations(
|
||||
static_cast<jbyte> (mapLocation.getFlags()));
|
||||
|
||||
if (jMapLocation == LocalRef::cms_nullPtr)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
setObjectArrayElement(*jlocs, index, *jMapLocation);
|
||||
}
|
||||
@@ -318,7 +318,7 @@ jobjectArray JNICALL ScriptMethodsMapNamespace::getPlanetaryMapCategories (JNI
|
||||
if(!JavaLibrary::convert(localCategory, categoryName))
|
||||
{
|
||||
DEBUG_WARNING(true, ("[script bug] invalid category passed to getPlanetaryMapCategories"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,14 +350,14 @@ jobject JNICALL ScriptMethodsMapNamespace::getPlanetaryMapLocation (JNI
|
||||
if (id == NetworkId::cms_invalid)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[script bug] invalid locationId passed to getPlanetaryMapCategories"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int mlt = 0;
|
||||
const MapLocation * const mapLocation = PlanetMapManagerServer::getLocation (id, mlt);
|
||||
|
||||
if (!mapLocation)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const JavaString jLocName (mapLocation->m_locationName);
|
||||
const JavaString jLocCategoryName (PlanetMapManager::findCategoryName (mapLocation->m_category));
|
||||
|
||||
@@ -310,7 +310,7 @@ jboolean JNICALL ScriptMethodsMentalStatesNamespace::addMentalStateModifier(JNIE
|
||||
* @param mob id of creature to access
|
||||
* @param mentalState mental state we are interested in
|
||||
*
|
||||
* @return the mental state modifiers for the creature, or null if it has none
|
||||
* @return the mental state modifiers for the creature, or nullptr if it has none
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsMentalStatesNamespace::getMentalStateModifiers(JNIEnv *env, jobject self, jlong mob, jint mentalState)
|
||||
{
|
||||
@@ -697,7 +697,7 @@ jboolean JNICALL ScriptMethodsMentalStatesNamespace::addMentalStateModifierTowar
|
||||
* @param mob id of creature to access
|
||||
* @param mentalState mental state we are interested in
|
||||
*
|
||||
* @return the mental state modifiers for the creature, or null if it has none
|
||||
* @return the mental state modifiers for the creature, or nullptr if it has none
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsMentalStatesNamespace::getMentalStateModifiersToward(JNIEnv *env, jobject self, jlong mob, jlong target, jint mentalState)
|
||||
{
|
||||
|
||||
@@ -170,17 +170,17 @@ void JNICALL ScriptMethodsMissionNamespace::abortMission(JNIEnv * env, jobject s
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] abortMission() missionObject is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] abortMission() missionObject is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] abortMission() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] abortMission() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] abortMission() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] abortMission() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,17 +283,17 @@ jstring JNICALL ScriptMethodsMissionNamespace::getMissionCreator(JNIEnv * env, j
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionCreator() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionCreator() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionCreator() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionCreator() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionCreator() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionCreator() JNIEnv is nullptr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -304,13 +304,13 @@ jobject JNICALL ScriptMethodsMissionNamespace::getMissionDescription(JNIEnv * en
|
||||
{
|
||||
if(! env)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDescription() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDescription() JNIEnv is nullptr"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(! missionObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionDescription() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionDescription() missionObject (parameter 1) is nullptr"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -352,17 +352,17 @@ jint JNICALL ScriptMethodsMissionNamespace::getMissionDifficulty(JNIEnv * env, j
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionDifficulty() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionDifficulty() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDifficulty() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDifficulty() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDifficulty() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionDifficulty() JNIEnv is nullptr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -390,7 +390,7 @@ jobject JNICALL ScriptMethodsMissionNamespace::getMissionEndLocation(JNIEnv * en
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionEndLocation() missionObject (parameter1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionEndLocation() missionObject (parameter1) is nullptr"));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -418,17 +418,17 @@ jint JNICALL ScriptMethodsMissionNamespace::getMissionReward(JNIEnv * env, jobje
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionReward() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionReward() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionReward() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionReward() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionReward() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionReward() JNIEnv is nullptr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -454,7 +454,7 @@ jobject JNICALL ScriptMethodsMissionNamespace::getMissionStartLocation(JNIEnv *
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionStartLocation() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionStartLocation() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -483,7 +483,7 @@ jstring JNICALL ScriptMethodsMissionNamespace::getMissionTargetName(JNIEnv * env
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionTargetName() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionTargetName() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ jobject JNICALL ScriptMethodsMissionNamespace::getMissionTitle(JNIEnv * env, job
|
||||
{
|
||||
if(! missionObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionTitle() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionTitle() missionObject (parameter 1) is nullptr"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ jstring JNICALL ScriptMethodsMissionNamespace::getMissionType(JNIEnv * env, jobj
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionType() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionType() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -556,7 +556,7 @@ jlong JNICALL ScriptMethodsMissionNamespace::getMissionHolder(JNIEnv * env, jobj
|
||||
MissionObject * mo = 0;
|
||||
if(JavaLibrary::getObject(missionObject, mo))
|
||||
{
|
||||
if (mo != NULL && mo->getMissionHolderId() != NetworkId::cms_invalid)
|
||||
if (mo != nullptr && mo->getMissionHolderId() != NetworkId::cms_invalid)
|
||||
{
|
||||
result = (mo->getMissionHolderId()).getValue();
|
||||
}
|
||||
@@ -572,17 +572,17 @@ jlong JNICALL ScriptMethodsMissionNamespace::getMissionHolder(JNIEnv * env, jobj
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionHolder() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionHolder() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionHolder() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionHolder() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionHolder() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] getMissionHolder() JNIEnv is nullptr"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -609,7 +609,7 @@ jstring JNICALL ScriptMethodsMissionNamespace::getMissionRootScriptName(JNIEnv *
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionRootScriptName() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getMissionRootScriptName() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -641,22 +641,22 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionCreator(JNIEnv *env, jobje
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionCreator() creator (parameter 2) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionCreator() creator (parameter 2) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionCreator() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionCreator() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionCreator() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionCreator() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionCreator() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionCreator() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -686,7 +686,7 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionDescription(JNIEnv * env,
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionDescription() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionDescription() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,7 +708,7 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionDifficulty(JNIEnv * env, j
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionDifficulty() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionDifficulty() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -764,17 +764,17 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionReward(JNIEnv * env, jobje
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionProfessionRank() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionProfessionRank() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionProfessionRank() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionProfessionRank() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionProfessionRank() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionProfessionRank() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionStartLocation(JNIEnv * env
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionStartLocation() location (parameter 2) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionStartLocation() location (parameter 2) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -816,17 +816,17 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionStartLocation(JNIEnv * env
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionStartLocation() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionStartLocation() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionStartLocation() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionStartLocation() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionStartLocation() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionStartLocation() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,17 +856,17 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionTargetAppearance(JNIEnv *
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTarget() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTarget() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -896,17 +896,17 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionTargetName(JNIEnv * env, j
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTarget() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTarget() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionTarget() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,7 +936,7 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionTitle(JNIEnv * env, jobjec
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTitle() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionTitle() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -969,22 +969,22 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionType(JNIEnv *env, jobject
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionType() typeName (parameter 2) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionType() typeName (parameter 2) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionType() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionType() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionType() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionType() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionType() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionType() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1022,22 +1022,22 @@ void JNICALL ScriptMethodsMissionNamespace::setMissionRootScriptName(JNIEnv *env
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionRootScriptName() rootScriptName (parameter 2) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionRootScriptName() rootScriptName (parameter 2) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionRootScriptName() missionObject (parameter 1) is NULL"));
|
||||
DEBUG_WARNING(true, ("[designer bug] setMissionRootScriptName() missionObject (parameter 1) is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionRootScriptName() self is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionRootScriptName() self is nullptr"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionRootScriptName() JNIEnv is NULL"));
|
||||
DEBUG_WARNING(true, ("[programmer bug] setMissionRootScriptName() JNIEnv is nullptr"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::transferCashTo(JNIEnv *env, jobjec
|
||||
return JNI_FALSE;
|
||||
ServerObject *sourceObj = ServerWorld::findObjectByNetworkId(sourceObjId);
|
||||
|
||||
if (sourceObj == NULL || targetObjId == NetworkId::cms_invalid || ownerOID == NetworkId::cms_invalid)
|
||||
if (sourceObj == nullptr || targetObjId == NetworkId::cms_invalid || ownerOID == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
// Do money transfer (will be forwarded if object is not authoritative)
|
||||
@@ -157,7 +157,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::transferBankCreditsTo(JNIEnv *env,
|
||||
return JNI_FALSE;
|
||||
ServerObject *sourceObj = ServerWorld::findObjectByNetworkId(sourceObjId);
|
||||
|
||||
if (sourceObj == NULL || targetObjId == NetworkId::cms_invalid || ownerOID == NetworkId::cms_invalid)
|
||||
if (sourceObj == nullptr || targetObjId == NetworkId::cms_invalid || ownerOID == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
// Do money transfer (will be forwarded if object is not authoritative)
|
||||
@@ -203,7 +203,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::withdrawCashFromBank (JNIEnv *env,
|
||||
return JNI_FALSE;
|
||||
ServerObject *sourceObj = ServerWorld::findObjectByNetworkId(sourceObjId);
|
||||
|
||||
if (sourceObj == NULL || ownerOID == NetworkId::cms_invalid)
|
||||
if (sourceObj == nullptr || ownerOID == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
// Do money transfer (will be forwarded if object is not authoritative)
|
||||
@@ -243,7 +243,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::depositCashToBank(JNIEnv *env, job
|
||||
if (failCallbackFunction != 0 && !JavaLibrary::convert(JavaStringParam(failCallbackFunction), failCallback))
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject *sourceObj = NULL;
|
||||
ServerObject *sourceObj = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObj))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -260,7 +260,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::depositCashToBank(JNIEnv *env, job
|
||||
|
||||
void JNICALL ScriptMethodsMoneyNamespace::depositToGalacticReserve(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject * objPlayer = NULL;
|
||||
CreatureObject * objPlayer = nullptr;
|
||||
if (!JavaLibrary::getObject(player, objPlayer) || !objPlayer)
|
||||
return;
|
||||
|
||||
@@ -275,7 +275,7 @@ void JNICALL ScriptMethodsMoneyNamespace::depositToGalacticReserve(JNIEnv *env,
|
||||
|
||||
void JNICALL ScriptMethodsMoneyNamespace::withdrawFromGalacticReserve(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject * objPlayer = NULL;
|
||||
CreatureObject * objPlayer = nullptr;
|
||||
if (!JavaLibrary::getObject(player, objPlayer) || !objPlayer)
|
||||
return;
|
||||
|
||||
@@ -290,7 +290,7 @@ void JNICALL ScriptMethodsMoneyNamespace::withdrawFromGalacticReserve(JNIEnv *en
|
||||
|
||||
jboolean JNICALL ScriptMethodsMoneyNamespace::canAccessGalacticReserve(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject * objPlayer = NULL;
|
||||
CreatureObject * objPlayer = nullptr;
|
||||
if (!JavaLibrary::getObject(player, objPlayer) || !objPlayer)
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -376,7 +376,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::transferBankCreditsToNamedAccount(
|
||||
return JNI_FALSE;
|
||||
ServerObject *sourceObj = ServerWorld::findObjectByNetworkId(sourceObjId);
|
||||
|
||||
if (sourceObj == NULL || targetString.size() == 0 || ownerOID == NetworkId::cms_invalid)
|
||||
if (sourceObj == nullptr || targetString.size() == 0 || ownerOID == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
// Do money transfer (will be forwarded if object is not authoritative)
|
||||
@@ -426,7 +426,7 @@ jboolean JNICALL ScriptMethodsMoneyNamespace::transferBankCreditsFromNamedAccoun
|
||||
return JNI_FALSE;
|
||||
ServerObject *targetObj = ServerWorld::findObjectByNetworkId(targetObjId);
|
||||
|
||||
if (targetObj == NULL || sourceString.size() == 0 || ownerOID == NetworkId::cms_invalid)
|
||||
if (targetObj == nullptr || sourceString.size() == 0 || ownerOID == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
// Do money transfer (will be forwarded if object is not authoritative)
|
||||
|
||||
@@ -235,7 +235,7 @@ void JNICALL ScriptMethodsMountNamespace::dismountCreature(JNIEnv *env, jobject
|
||||
CreatureObject *const mountObject = riderObject->getMountedCreature();
|
||||
if (!mountObject)
|
||||
{
|
||||
LOG(LOCAL_LOG_CHANNEL, ("JavaLibrary::dismountCreature(): server id=[%d],rider id=[%s] has RidingMount state but CreatureObject::getMountedCreature() returns NULL, skipping dismount.", GameServer::getInstance().getProcessId(), riderObject->getNetworkId().getValueString().c_str()));
|
||||
LOG(LOCAL_LOG_CHANNEL, ("JavaLibrary::dismountCreature(): server id=[%d],rider id=[%s] has RidingMount state but CreatureObject::getMountedCreature() returns nullptr, skipping dismount.", GameServer::getInstance().getProcessId(), riderObject->getNetworkId().getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ void JNICALL JNICALL ScriptMethodsMountNamespace::makeContainerStateInconsistent
|
||||
//-- Get the ServerObject from the object id.
|
||||
if (!containedObjectId)
|
||||
{
|
||||
LOG("script-bug", ("makeContainerStateInconsistentTestOnly(): containedObjectId is NULL"));
|
||||
LOG("script-bug", ("makeContainerStateInconsistentTestOnly(): containedObjectId is nullptr"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ void JNICALL JNICALL ScriptMethodsMountNamespace::makeContainerStateInconsistent
|
||||
Container* container = ContainerInterface::getContainer(*containerObject);
|
||||
if (!container)
|
||||
{
|
||||
LOG("script-bug", ("makeContainerStateInconsistentTestOnly(): containerObject [%s] returned a NULL container", containerObject->getNetworkId().getValueString().c_str()));
|
||||
LOG("script-bug", ("makeContainerStateInconsistentTestOnly(): containerObject [%s] returned a nullptr container", containerObject->getNetworkId().getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@ jobject JNICALL ScriptMethodsNewbieTutorialNamespace::getStartingLocationInf
|
||||
|
||||
if (!jName)
|
||||
{
|
||||
WARNING (true, ("getStartingLocationInfo null name"));
|
||||
WARNING (true, ("getStartingLocationInfo nullptr name"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
|
||||
jint JNICALL ScriptMethodsNotificationNamespace::addNotification(JNIEnv *env, jobject self, jlong player, jstring contents, jboolean useNotificationIcon, jint iconStyle, jfloat timeout, jint channel, jstring sound)
|
||||
{
|
||||
CreatureObject const * playerObject = NULL;
|
||||
CreatureObject const * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return 0;
|
||||
|
||||
@@ -79,7 +79,7 @@ jint JNICALL ScriptMethodsNotificationNamespace::addNotification(JNIEnv *env, jo
|
||||
|
||||
void JNICALL ScriptMethodsNotificationNamespace::cancelNotification(JNIEnv *env, jobject self, jlong player, jint notification)
|
||||
{
|
||||
CreatureObject const * playerObject = NULL;
|
||||
CreatureObject const * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return;
|
||||
ClientNotificationBoxMessage cnbm(notification, playerObject->getNetworkId(), Unicode::emptyString, FALSE, 0, 0.0f, ClientNotificationBoxMessage::NC_SPECIAL_CANCEL, std::string(""));
|
||||
@@ -94,7 +94,7 @@ void JNICALL ScriptMethodsNotificationNamespace::cancelNotification(JNIEnv *env,
|
||||
|
||||
void JNICALL ScriptMethodsNotificationNamespace::cancelAllNotifications(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject const * playerObject = NULL;
|
||||
CreatureObject const * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return;
|
||||
ClientNotificationBoxMessage cnbm(0, playerObject->getNetworkId(), Unicode::emptyString, FALSE, 0, 0.0f, ClientNotificationBoxMessage::NC_SPECIAL_CANCEL_ALL, std::string(""));
|
||||
|
||||
@@ -190,14 +190,14 @@ jboolean JNICALL ScriptMethodsNpcNamespace::_npcStartConversation(JNIEnv *env, j
|
||||
if (!JavaLibrary::convert (localConvoName, convoNameStr))
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
if (playerObject->isInNpcConversation())
|
||||
return JNI_FALSE;
|
||||
|
||||
TangibleObject * npcObject = NULL;
|
||||
TangibleObject * npcObject = nullptr;
|
||||
if (!JavaLibrary::getObject(npc, npcObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -234,7 +234,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::_npcStartConversation(JNIEnv *env, j
|
||||
|
||||
jboolean JNICALL ScriptMethodsNpcNamespace::npcStartConversation(JNIEnv *env, jobject self, jlong player, jlong npc, jstring convoName, jobject greeting, jstring greetingOob, jobjectArray responses)
|
||||
{
|
||||
TangibleObject * speakerObject = NULL;
|
||||
TangibleObject * speakerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(npc, speakerObject) || !speakerObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -243,7 +243,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcStartConversation(JNIEnv *env, jo
|
||||
|
||||
uint32 crc = Crc::crcNull;
|
||||
ObjectTemplate const * const ot = ObjectTemplateList::fetch(conversationAppearanceOverride);
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : NULL;
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : nullptr;
|
||||
if(sot)
|
||||
{
|
||||
std::string const & sharedTemplateName = sot->getSharedTemplate();
|
||||
@@ -263,7 +263,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcStartConversationAppearanceOverri
|
||||
return JNI_FALSE;
|
||||
|
||||
ObjectTemplate const * const ot = ObjectTemplateList::fetch(appearanceOverrideSharedTemplateNameStr);
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : NULL;
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : nullptr;
|
||||
if(!sot)
|
||||
{
|
||||
return JNI_FALSE;
|
||||
@@ -290,7 +290,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcEndConversation(JNIEnv *env, jobj
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -318,7 +318,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcSpeak(JNIEnv *env, jobject self,
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -367,7 +367,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcSetConversationResponses(JNIEnv *
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -396,7 +396,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcAddConversationResponse(JNIEnv *e
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -455,7 +455,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcRemoveConversationResponse(JNIEnv
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -488,7 +488,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::isInNpcConversation(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * tangibleObject = NULL;
|
||||
TangibleObject * tangibleObject = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, tangibleObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -506,13 +506,13 @@ jboolean JNICALL ScriptMethodsNpcNamespace::isInNpcConversation(JNIEnv *env, job
|
||||
* @param self class calling this function
|
||||
* @param creature creature being asked about
|
||||
*
|
||||
* @return an array of obj_ids the creature is in conversation with, or null on error
|
||||
* @return an array of obj_ids the creature is in conversation with, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsNpcNamespace::getNpcConversants(JNIEnv *env, jobject self, jlong creature)
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
TangibleObject * tangibleObject = NULL;
|
||||
TangibleObject * tangibleObject = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, tangibleObject))
|
||||
return 0;
|
||||
|
||||
@@ -621,7 +621,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::isNameReservedIgnoreRules(JNIEnv *en
|
||||
|
||||
jboolean JNICALL ScriptMethodsNpcNamespace::npcEndConversationWithMessage(JNIEnv * /*env*/, jobject /*self*/, jlong player, jobject response, jstring responseOob)
|
||||
{
|
||||
TangibleObject * playerObject = NULL;
|
||||
TangibleObject * playerObject = nullptr;
|
||||
if(!JavaLibrary::getObject(player, playerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -658,7 +658,7 @@ jboolean JNICALL ScriptMethodsNpcNamespace::npcEndConversationWithMessage(JNIEnv
|
||||
|
||||
jboolean JNICALL ScriptMethodsNpcNamespace::setNpcDifficulty(JNIEnv *env, jobject self, jlong npc, jlong difficulty)
|
||||
{
|
||||
TangibleObject * npcObject = NULL;
|
||||
TangibleObject * npcObject = nullptr;
|
||||
if (!JavaLibrary::getObject(npc, npcObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -257,11 +257,11 @@ jlong ScriptMethodsObjectCreateNamespace::createTheater(const std::vector<jint>
|
||||
float centerX = minx + dx / 2.0f + center.x;
|
||||
float centerZ = minz + dz / 2.0f + center.z;
|
||||
|
||||
TerrainGenerator::Layer * layer = NULL;
|
||||
TerrainGenerator::Layer * layer = nullptr;
|
||||
if (locationType == IntangibleObject::TLT_flatten)
|
||||
{
|
||||
layer = TerrainModificationHelper::importLayer(THEATER_FLATTEN_LAYER.c_str());
|
||||
if (layer == NULL)
|
||||
if (layer == nullptr)
|
||||
{
|
||||
WARNING (true, ("Layer %s not found for theater, using getGoodLocation "
|
||||
"instead", THEATER_FLATTEN_LAYER.c_str()));
|
||||
@@ -292,7 +292,7 @@ jlong ScriptMethodsObjectCreateNamespace::createTheater(const std::vector<jint>
|
||||
IntangibleObject * theater = safe_cast<IntangibleObject *>(ServerWorld::createNewObject(THEATER_TEMPLATE, tr, 0, false));
|
||||
NOT_NULL(theater);
|
||||
theater->setTheater();
|
||||
if (layer != NULL)
|
||||
if (layer != nullptr)
|
||||
{
|
||||
theater->setLayer(layer);
|
||||
}
|
||||
@@ -328,7 +328,7 @@ jlong ScriptMethodsObjectCreateNamespace::createTheater(const std::vector<jint>
|
||||
* @param source the template id or the object id to create the object with
|
||||
* @param location where to put the object
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInWorld(JNIEnv *env, jobject self, jlong source, jobject location)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInWorld(JNIEnv
|
||||
// determine what source is and create the object
|
||||
std::string localName;
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(source, object))
|
||||
return 0;
|
||||
localName = object->getTemplateName();
|
||||
@@ -366,7 +366,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInWorld(JNIEnv
|
||||
* @param source the template id or the object id to create the object with
|
||||
* @param location where to put the object
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInWorldString(JNIEnv *env, jobject self, jobject source, jobject location)
|
||||
{
|
||||
@@ -445,7 +445,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectAt(JNIEnv *env,
|
||||
* @param container the object we want to put our new object into
|
||||
* @param slot the container slot we want to put the object in
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainer(JNIEnv *env, jobject self, jlong source, jlong container, jstring slot)
|
||||
{
|
||||
@@ -457,7 +457,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainer(JNI
|
||||
// determine what source is and create the object
|
||||
std::string templateName;
|
||||
|
||||
const ServerObject* object = NULL;
|
||||
const ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(source, object))
|
||||
return 0;
|
||||
templateName = object->getTemplateName();
|
||||
@@ -536,7 +536,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerOver
|
||||
|
||||
// determine what source is and create the object
|
||||
std::string templateName;
|
||||
const ServerObject* object = NULL;
|
||||
const ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(source, object))
|
||||
return 0;
|
||||
templateName = object->getTemplateName();
|
||||
@@ -598,7 +598,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerOver
|
||||
* @param sourceName the template name used to create the object
|
||||
* @param target the creature to create the object in
|
||||
*
|
||||
* @return the obj_id of the created object, or null on error
|
||||
* @return the obj_id of the created object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOverloaded(JNIEnv *env, jobject self, jstring sourceName, jlong target)
|
||||
{
|
||||
@@ -624,7 +624,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOver
|
||||
* @param sourceCrc the template crc to create the object with
|
||||
* @param location where to put the object
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectCrc(JNIEnv *env, jobject self, int sourceCrc, jobject location)
|
||||
{
|
||||
@@ -656,7 +656,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectCrc(JNIEnv *env
|
||||
Transform tr;
|
||||
tr.setPosition_p(newPos);
|
||||
ServerObject *newObject = ServerWorld::createNewObject(sourceCrc, tr, cell, false);
|
||||
if (newObject != NULL)
|
||||
if (newObject != nullptr)
|
||||
{
|
||||
// get the networkId to return
|
||||
NetworkId netId = newObject->getNetworkId();
|
||||
@@ -693,7 +693,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectCrc(JNIEnv *env
|
||||
* @param container the object we want to put our new object into
|
||||
* @param slot the container slot we want to put the object in
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerCrc(JNIEnv *env, jobject self, int sourceCrc, jlong container, jstring slot)
|
||||
{
|
||||
@@ -707,10 +707,10 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerCrc(
|
||||
return 0;
|
||||
|
||||
// make sure the container exists
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
if (ContainerInterface::getContainer(*containerOwner) == NULL)
|
||||
if (ContainerInterface::getContainer(*containerOwner) == nullptr)
|
||||
return 0;
|
||||
|
||||
//Create the object
|
||||
@@ -773,10 +773,10 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerOver
|
||||
return 0;
|
||||
|
||||
// make sure the container exists
|
||||
ServerObject * containerOwner = NULL;
|
||||
ServerObject * containerOwner = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerOwner))
|
||||
return 0;
|
||||
if (ContainerInterface::getVolumeContainer(*containerOwner) == NULL)
|
||||
if (ContainerInterface::getVolumeContainer(*containerOwner) == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("createObjectin an overloaded container only works on volume containers"));
|
||||
return 0;
|
||||
@@ -811,7 +811,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInContainerOver
|
||||
* @param sourceCrc the template crc used to create the object
|
||||
* @param target the creature to create the object in
|
||||
*
|
||||
* @return the obj_id of the created object, or null on error
|
||||
* @return the obj_id of the created object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOverloadedCrc(
|
||||
JNIEnv *env, jobject self, int sourceCrc, jlong target)
|
||||
@@ -819,16 +819,16 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOver
|
||||
if (sourceCrc == 0 || target == 0)
|
||||
return 0;
|
||||
|
||||
CreatureObject * targetObject = NULL;
|
||||
CreatureObject * targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return 0;
|
||||
|
||||
ServerObject * inventory = targetObject->getInventory();
|
||||
if (inventory == NULL)
|
||||
if (inventory == nullptr)
|
||||
return 0;
|
||||
|
||||
VolumeContainer * volContainer = ContainerInterface::getVolumeContainer(*inventory);
|
||||
if (volContainer == NULL)
|
||||
if (volContainer == nullptr)
|
||||
return 0;
|
||||
|
||||
int oldCapacity = volContainer->debugDoNotUseSetCapacity(-1);
|
||||
@@ -838,7 +838,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOver
|
||||
volContainer->debugDoNotUseSetCapacity(oldCapacity);
|
||||
volContainer->recalculateVolume();
|
||||
|
||||
if (newObject == NULL)
|
||||
if (newObject == nullptr)
|
||||
return 0;
|
||||
|
||||
return (newObject->getNetworkId()).getValue();
|
||||
@@ -852,7 +852,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectInInventoryOver
|
||||
* @param self class calling this function
|
||||
* @param sourceCrc the template crc of the new object to create
|
||||
* @param target an object whose location and container/cell will be used to create the object.
|
||||
* @return the obj_id of the created object, or null on error
|
||||
* @return the obj_id of the created object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectAtCrc(JNIEnv *env, jobject self, int sourceCrc, jlong target)
|
||||
{
|
||||
@@ -863,7 +863,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectAtCrc(JNIEnv *e
|
||||
if (target == 0)
|
||||
return 0;
|
||||
|
||||
ServerObject *sourceObject = NULL;
|
||||
ServerObject *sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, sourceObject))
|
||||
return 0;
|
||||
|
||||
@@ -878,7 +878,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectAtCrc(JNIEnv *e
|
||||
Transform tr;
|
||||
tr.setPosition_p(sourceObject->getPosition_p());
|
||||
ServerObject *newObject = ServerWorld::createNewObject(sourceCrc, tr, cell, false);
|
||||
if (newObject == NULL)
|
||||
if (newObject == nullptr)
|
||||
{
|
||||
fprintf(stderr, "WARNING: Could not create object from crc %d\n", sourceCrc);
|
||||
JavaLibrary::printJavaStack();
|
||||
@@ -911,7 +911,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectAtCrc(JNIEnv *e
|
||||
* @param source the template id or the object id to create the object with
|
||||
* @param location where to put the object
|
||||
*
|
||||
* @return the new object, or null on error
|
||||
* @return the new object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectSimulator(JNIEnv *env, jobject self, jstring source, jobject location)
|
||||
{
|
||||
@@ -963,7 +963,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectSimulator(JNIEn
|
||||
Transform tr;
|
||||
tr.setPosition_p(newPos);
|
||||
ServerObject *newObject = ServerWorld::createNewObject(sourceCrc, tr, cell, false);
|
||||
if (newObject != NULL)
|
||||
if (newObject != nullptr)
|
||||
{
|
||||
// add on the player object
|
||||
CreatureObject * creature = dynamic_cast<CreatureObject *>(newObject);
|
||||
@@ -1007,7 +1007,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectSimulator(JNIEn
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsObjectCreateNamespace::destroyObjectSimulator(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
CreatureObject *playerObject = NULL;
|
||||
CreatureObject *playerObject = nullptr;
|
||||
// get the object
|
||||
if (!JavaLibrary::getObject(target, playerObject))
|
||||
{
|
||||
@@ -1046,7 +1046,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::destroyObject(JNIEnv *env,
|
||||
if (targetId == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
bool retval = JavaLibrary::getObject(target, object);
|
||||
|
||||
if (!retval || !object) // || object->isPersisted()) will be done in permanently destroy
|
||||
@@ -1060,7 +1060,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::destroyObject(JNIEnv *env,
|
||||
{
|
||||
// check if the object is in a FactoryObject crate
|
||||
Object * container = ContainerInterface::getContainedByObject(*object);
|
||||
if (container != NULL && dynamic_cast<FactoryObject *>(container) != NULL)
|
||||
if (container != nullptr && dynamic_cast<FactoryObject *>(container) != nullptr)
|
||||
{
|
||||
// destroy an object in the factory; if it is the last object,
|
||||
// the factory will destroy itself
|
||||
@@ -1093,7 +1093,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::destroyObjectHyperspace(JNI
|
||||
if (targetId == NetworkId::cms_invalid)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
bool retval = JavaLibrary::getObject(target, object);
|
||||
if(retval && object)
|
||||
{
|
||||
@@ -1120,7 +1120,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::persistObject(JNIEnv *env,
|
||||
UNREF(self);
|
||||
NOT_NULL(env);
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
if (object->persist()) {
|
||||
@@ -1144,7 +1144,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::isObjectPersisted(JNIEnv *e
|
||||
UNREF(self);
|
||||
NOT_NULL(env);
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createNewObjectTransformCrcInt
|
||||
* @param name the name of the theater
|
||||
* @param locationType how to create the theater
|
||||
*
|
||||
* @return the id of the master theater object, or null on error (bad datatable name or position)
|
||||
* @return the id of the master theater object, or nullptr on error (bad datatable name or position)
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createTheaterDatatableOnly(JNIEnv *env, jobject self, jstring datatable, jlong caller, jstring name, jint locationType)
|
||||
{
|
||||
@@ -1347,7 +1347,7 @@ int i;
|
||||
|
||||
// read the object data from the datatable
|
||||
DataTable * dt = DataTableManager::getTable(datatableName, true);
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createTheaterDatatable could not open "
|
||||
"datatable %s", datatableName.c_str()));
|
||||
@@ -1429,7 +1429,7 @@ int i;
|
||||
* @param name the name of the theater
|
||||
* @param locationType how to create the theater
|
||||
*
|
||||
* @return the id of the master theater object, or null on error (bad datatable name or position)
|
||||
* @return the id of the master theater object, or nullptr on error (bad datatable name or position)
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createTheaterDatatable(JNIEnv *env, jobject self, jstring datatable, jobject basePosition, jstring script, jlong caller, jstring name, jint locationType)
|
||||
{
|
||||
@@ -1466,7 +1466,7 @@ int i;
|
||||
|
||||
// read the object data from the datatable
|
||||
DataTable * dt = DataTableManager::getTable(datatableName, true);
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createTheaterDatatable could not open "
|
||||
"datatable %s", datatableName.c_str()));
|
||||
@@ -1567,7 +1567,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
|
||||
// read the object data from the datatable
|
||||
DataTable * dt = DataTableManager::getTable(datatableName, true);
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable could not open "
|
||||
"datatable %s", datatableName.c_str()));
|
||||
@@ -1613,7 +1613,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
params.addParam(locationType, "locationType");
|
||||
ScriptDictionaryPtr dictionary;
|
||||
GameScriptObject::makeScriptDictionary(params, dictionary);
|
||||
if (dictionary.get() == NULL)
|
||||
if (dictionary.get() == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable could not "
|
||||
"create dictionary for theater datatable %s", datatableName.c_str()));
|
||||
@@ -1624,7 +1624,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
Transform tr;
|
||||
tr.setPosition_p(location);
|
||||
ServerObject * spawner = ServerWorld::createNewObject("object/tangible/spawning/remote_theater_spawner.iff", tr, 0, false);
|
||||
if (spawner == NULL)
|
||||
if (spawner == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable unable to "
|
||||
"create remote theater spawner for datatable %s", datatableName.c_str()));
|
||||
@@ -1704,7 +1704,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
|
||||
// read the object data from the datatable
|
||||
DataTable * dt = DataTableManager::getTable(datatableName, true);
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable could not open "
|
||||
"datatable %s", datatableName.c_str()));
|
||||
@@ -1734,7 +1734,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
params.addParam(locationType, "locationType");
|
||||
ScriptDictionaryPtr dictionary;
|
||||
GameScriptObject::makeScriptDictionary(params, dictionary);
|
||||
if (dictionary.get() == NULL)
|
||||
if (dictionary.get() == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable could not "
|
||||
"create dictionary for theater datatable %s", datatableName.c_str()));
|
||||
@@ -1747,7 +1747,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
Transform tr;
|
||||
tr.setPosition_p(theaterCenter);
|
||||
ServerObject * spawner = ServerWorld::createNewObject("object/tangible/spawning/remote_theater_spawner.iff", tr, 0, false);
|
||||
if (spawner == NULL)
|
||||
if (spawner == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createRemoteTheaterDatatable unable to "
|
||||
"create remote theater spawner for datatable %s", datatableName.c_str()));
|
||||
@@ -1778,7 +1778,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::createRemoteTheaterDatatabl
|
||||
* theater objects have been created
|
||||
* @param caller who's creating the theater
|
||||
*
|
||||
* @return the id of the master theater object, or null on error
|
||||
* @return the id of the master theater object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createTheaterCrc(JNIEnv *env, jobject self, jintArray crcs, jobjectArray positions, jobject basePosition, jstring script, jlong caller)
|
||||
{
|
||||
@@ -1843,7 +1843,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createTheaterCrc(JNIEnv *env,
|
||||
* theater objects have been created
|
||||
* @param caller who's creating the theater
|
||||
*
|
||||
* @return the id of the master theater object, or null on error
|
||||
* @return the id of the master theater object, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createTheaterString(JNIEnv *env, jobject self, jobjectArray templates, jobjectArray positions, jobject basePosition, jstring script, jlong caller)
|
||||
{
|
||||
@@ -1922,13 +1922,13 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::assignTheaterToPlayer(JNIEn
|
||||
|
||||
JavaStringParam jdatatable(datatable);
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(playerId, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject * const player = PlayerCreatureController::getPlayerObject(
|
||||
playerCreature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
if (player->hasTheater())
|
||||
@@ -1962,7 +1962,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::assignTheaterToPlayer(JNIEn
|
||||
|
||||
// read the object data from the datatable
|
||||
DataTable * dt = DataTableManager::getTable(datatableName, true);
|
||||
if (dt == NULL)
|
||||
if (dt == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::assignTheaterToPlayer could not open "
|
||||
"datatable %s", datatableName.c_str()));
|
||||
@@ -2026,13 +2026,13 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::assignTheaterToPlayerLocati
|
||||
JavaStringParam jdatatable(datatable);
|
||||
JavaStringParam jscript(script);
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(playerId, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject * const player = PlayerCreatureController::getPlayerObject(
|
||||
playerCreature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::string datatableName;
|
||||
@@ -2094,13 +2094,13 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::unassignTheaterFromPlayer(J
|
||||
if (playerId == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(playerId, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
PlayerObject * const player = PlayerCreatureController::getPlayerObject(
|
||||
playerCreature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
player->clearTheater();
|
||||
@@ -2123,13 +2123,13 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::hasTheaterAssigned(JNIEnv *
|
||||
if (playerId == 0)
|
||||
return JNI_FALSE;
|
||||
|
||||
const CreatureObject * playerCreature = NULL;
|
||||
const CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(playerId, playerCreature))
|
||||
return JNI_FALSE;
|
||||
|
||||
const PlayerObject * player = PlayerCreatureController::getPlayerObject(
|
||||
playerCreature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
return player->hasTheater();
|
||||
@@ -2142,7 +2142,7 @@ jboolean JNICALL ScriptMethodsObjectCreateNamespace::hasTheaterAssigned(JNIEnv *
|
||||
*
|
||||
* @param theater the theater id
|
||||
*
|
||||
* @return the theater's name, or null if it doesn't have one
|
||||
* @return the theater's name, or nullptr if it doesn't have one
|
||||
*/
|
||||
jstring JNICALL ScriptMethodsObjectCreateNamespace::getTheaterName(JNIEnv *env, jobject self, jlong theater)
|
||||
{
|
||||
@@ -2167,7 +2167,7 @@ jstring JNICALL ScriptMethodsObjectCreateNamespace::getTheaterName(JNIEnv *env,
|
||||
*
|
||||
* @param name the theater name to look for
|
||||
*
|
||||
* @return the theater's id, or null if the theater doesn't exist
|
||||
* @return the theater's id, or nullptr if the theater doesn't exist
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::findTheater(JNIEnv *env, jobject self, jstring name)
|
||||
{
|
||||
@@ -2196,7 +2196,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::findTheater(JNIEnv *env, jobje
|
||||
* @param draftSchematic the draft schematic template to create the manufacturing schematic from
|
||||
* @param container the container to put the manufacturing schematic in
|
||||
*
|
||||
* @return the id of the manufacturing schematic, or null on error
|
||||
* @return the id of the manufacturing schematic, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createSchematicString(JNIEnv *env, jobject self, jstring draftSchematic, jlong container)
|
||||
{
|
||||
@@ -2222,25 +2222,25 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createSchematicString(JNIEnv *
|
||||
* @param draftSchematicCrc the draft schematic template crc value to create the manufacturing schematic from
|
||||
* @param container the container to put the manufacturing schematic in
|
||||
*
|
||||
* @return the id of the manufacturing schematic, or null on error
|
||||
* @return the id of the manufacturing schematic, or nullptr on error
|
||||
*/
|
||||
jlong JNICALL ScriptMethodsObjectCreateNamespace::createSchematicCrc(JNIEnv *env, jobject self, jint draftSchematicCrc, jlong container)
|
||||
{
|
||||
if (draftSchematicCrc == 0 || container == 0)
|
||||
return 0;
|
||||
|
||||
ServerObject * containerObject = NULL;
|
||||
ServerObject * containerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(container, containerObject))
|
||||
return 0;
|
||||
|
||||
const DraftSchematicObject * const draftSchematic = DraftSchematicObject::getSchematic(
|
||||
draftSchematicCrc);
|
||||
if (draftSchematic == NULL)
|
||||
if (draftSchematic == nullptr)
|
||||
return 0;
|
||||
|
||||
ManufactureSchematicObject * manfSchematic = ServerWorld::createNewManufacturingSchematic(
|
||||
*draftSchematic, *containerObject, false);
|
||||
if (manfSchematic == NULL)
|
||||
if (manfSchematic == nullptr)
|
||||
return 0;
|
||||
|
||||
return (manfSchematic->getNetworkId()).getValue();
|
||||
@@ -2260,7 +2260,7 @@ jlong JNICALL ScriptMethodsObjectCreateNamespace::createSchematicCrc(JNIEnv *env
|
||||
|
||||
jboolean JNICALL ScriptMethodsObjectCreateNamespace::updateNetworkTriggerVolume(JNIEnv *env, jobject self, jlong target, jfloat radius)
|
||||
{
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -215,7 +215,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
*/
|
||||
bool ScriptMethodsObjectMoveNamespace::testInvalidObjectMove(const ServerObject * object)
|
||||
{
|
||||
if (object->getCacheVersion() > 0 || object->getCellProperty() != NULL)
|
||||
if (object->getCacheVersion() > 0 || object->getCellProperty() != nullptr)
|
||||
{
|
||||
char buffer[1024];
|
||||
sprintf(buffer, "A script is trying to move object %s, which is a cached "
|
||||
@@ -323,7 +323,7 @@ jboolean JNICALL ScriptMethodsObjectMoveNamespace::setLocationFromObj(JNIEnv *en
|
||||
* @param self class calling this function
|
||||
* @param objectId object to get
|
||||
*
|
||||
* @return the object's location, or null on error
|
||||
* @return the object's location, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsObjectMoveNamespace::getLocation(JNIEnv *env, jobject self, jlong objectId)
|
||||
{
|
||||
@@ -337,13 +337,13 @@ jobject JNICALL ScriptMethodsObjectMoveNamespace::getLocation(JNIEnv *env, jobje
|
||||
// (e.g. for mounts, the immediate Container is the mount).
|
||||
NOT_NULL(object);
|
||||
CellProperty const *const cellProperty = object->getParentCell();
|
||||
Object const *const cell = (cellProperty != NULL) ? &(cellProperty->getOwner()) : NULL;
|
||||
Object const *const cell = (cellProperty != nullptr) ? &(cellProperty->getOwner()) : nullptr;
|
||||
|
||||
// Remember, just because we're not in a cell doesn't mean we're not contained by something else,
|
||||
// particularly in the case of a rider mounted where the mount is in the world cell.
|
||||
Vector const positionRelativeToCellOrWorld = (cell != NULL) ? object->getPosition_c() :
|
||||
Vector const positionRelativeToCellOrWorld = (cell != nullptr) ? object->getPosition_c() :
|
||||
object->getPosition_w();
|
||||
NetworkId const &networkIdForCellOrWorld = (cell != NULL) ? cell->getNetworkId() :
|
||||
NetworkId const &networkIdForCellOrWorld = (cell != nullptr) ? cell->getNetworkId() :
|
||||
NetworkId::cms_invalid;
|
||||
|
||||
LocalRefPtr location;
|
||||
@@ -362,7 +362,7 @@ jobject JNICALL ScriptMethodsObjectMoveNamespace::getLocation(JNIEnv *env, jobje
|
||||
* @param self class calling this function
|
||||
* @param objectId object to get
|
||||
*
|
||||
* @return the object's world location, or null on error
|
||||
* @return the object's world location, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsObjectMoveNamespace::getWorldLocation(JNIEnv *env, jobject self, jlong objectId)
|
||||
{
|
||||
@@ -387,7 +387,7 @@ jobject JNICALL ScriptMethodsObjectMoveNamespace::getWorldLocation(JNIEnv *env,
|
||||
* @param self class calling this function
|
||||
* @param objectId object to get
|
||||
*
|
||||
* @return the object's location, or null on error
|
||||
* @return the object's location, or nullptr on error
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsObjectMoveNamespace::getHeading(JNIEnv *env, jobject self, jlong objectId)
|
||||
{
|
||||
@@ -553,7 +553,7 @@ jboolean JNICALL ScriptMethodsObjectMoveNamespace::faceToBehavior(JNIEnv *env, j
|
||||
|
||||
jfloat JNICALL ScriptMethodsObjectMoveNamespace::getYaw(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
const ServerObject * object = NULL;
|
||||
const ServerObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return -1.0f;
|
||||
|
||||
@@ -565,7 +565,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getYaw(JNIEnv *env, jobject sel
|
||||
jboolean JNICALL ScriptMethodsObjectMoveNamespace::setYaw(JNIEnv *env, jobject self, jlong target, jfloat yaw)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::setYaw");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::setYaw::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -608,7 +608,7 @@ jboolean JNICALL ScriptMethodsObjectMoveNamespace::setYaw(JNIEnv *env, jobject s
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::modifyYaw(JNIEnv *env, jobject self, jlong target, jfloat degrees)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyYaw");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyYaw::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -650,7 +650,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::modifyYaw(JNIEnv *env, jobject se
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::modifyPitch(JNIEnv *env, jobject self, jlong target, jfloat degrees)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyPitch");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyPitch::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -692,7 +692,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::modifyPitch(JNIEnv *env, jobject
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::modifyRoll(JNIEnv *env, jobject self, jlong target, jfloat degrees)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyRoll");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::modifyRoll::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -734,7 +734,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::modifyRoll(JNIEnv *env, jobject s
|
||||
jfloatArray JNICALL ScriptMethodsObjectMoveNamespace::getQuaternion(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::getQuaternion");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::getQuaternion::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -771,7 +771,7 @@ jfloatArray JNICALL ScriptMethodsObjectMoveNamespace::getQuaternion(JNIEnv *env,
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::setQuaternion(JNIEnv *env, jobject self, jlong target, jfloat qw, jfloat qx, jfloat qy, jfloat qz)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::setQuaternion");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::setQuaternion::getObject");
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
@@ -804,7 +804,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setQuaternion(JNIEnv *env, jobjec
|
||||
jint JNICALL ScriptMethodsObjectMoveNamespace::getFurnitureRotationDegree(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::getFurnitureRotationDegree");
|
||||
ServerObject * object = NULL;
|
||||
ServerObject * object = nullptr;
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JavaLibrary::getFurnitureRotationDegree::getObject");
|
||||
if (!JavaLibrary::getObject(player, object))
|
||||
@@ -823,11 +823,11 @@ jint JNICALL ScriptMethodsObjectMoveNamespace::getFurnitureRotationDegree(JNIEnv
|
||||
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::saveDecorationLayout(JNIEnv *env, jobject self, jlong player, jlong pob, jint saveSlotNumber, jstring description)
|
||||
{
|
||||
CreatureObject * playerObject = NULL;
|
||||
CreatureObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject) || !playerObject)
|
||||
return;
|
||||
|
||||
ServerObject const * pobObject = NULL;
|
||||
ServerObject const * pobObject = nullptr;
|
||||
if (!JavaLibrary::getObject(pob, pobObject) || !pobObject)
|
||||
return;
|
||||
|
||||
@@ -843,11 +843,11 @@ void JNICALL ScriptMethodsObjectMoveNamespace::saveDecorationLayout(JNIEnv *env,
|
||||
|
||||
void JNICALL ScriptMethodsObjectMoveNamespace::restoreDecorationLayout(JNIEnv *env, jobject self, jlong player, jlong pob, jint saveSlotNumber)
|
||||
{
|
||||
CreatureObject * playerObject = NULL;
|
||||
CreatureObject * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject) || !playerObject)
|
||||
return;
|
||||
|
||||
ServerObject const * pobObject = NULL;
|
||||
ServerObject const * pobObject = nullptr;
|
||||
if (!JavaLibrary::getObject(pob, pobObject) || !pobObject)
|
||||
return;
|
||||
|
||||
@@ -1402,11 +1402,11 @@ jobject JNICALL ScriptMethodsObjectMoveNamespace::getConnectedPlayerLocation(JNI
|
||||
std::map<NetworkId, LfgCharacterData> const & connectedCharacterLfgData = ServerUniverse::getConnectedCharacterLfgData();
|
||||
std::map<NetworkId, LfgCharacterData>::const_iterator const iterFind = connectedCharacterLfgData.find(NetworkId(static_cast<NetworkId::NetworkIdType>(player)));
|
||||
if (iterFind == connectedCharacterLfgData.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalRefPtr dictionary = createNewObject(JavaLibrary::getClsDictionary(), JavaLibrary::getMidDictionary());
|
||||
if (dictionary == LocalRef::cms_nullPtr)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
callObjectMethod(*dictionary, JavaLibrary::getMidDictionaryPut(), JavaString("planet").getValue(), JavaString(iterFind->second.locationPlanet).getValue());
|
||||
|
||||
@@ -1457,7 +1457,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getMovementSpeed(JNIEnv * /*env
|
||||
NetworkId const networkId(object);
|
||||
CreatureController * const creatureController = CreatureController::getCreatureController(networkId);
|
||||
|
||||
return (creatureController != NULL) ? creatureController->getCurrentVelocity().magnitude() : 0.0f;
|
||||
return (creatureController != nullptr) ? creatureController->getCurrentVelocity().magnitude() : 0.0f;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1467,7 +1467,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getWalkSpeed(JNIEnv * /*env*/,
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
return (creatureObject != NULL) ? creatureObject->getWalkSpeed() : 0.0f;
|
||||
return (creatureObject != nullptr) ? creatureObject->getWalkSpeed() : 0.0f;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1477,7 +1477,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getRunSpeed(JNIEnv * /*env*/, j
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
return (creatureObject != NULL) ? creatureObject->getRunSpeed() : 0.0f;
|
||||
return (creatureObject != nullptr) ? creatureObject->getRunSpeed() : 0.0f;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1487,7 +1487,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setBaseWalkSpeed(JNIEnv * /*env*/
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
if (creatureObject == NULL)
|
||||
if (creatureObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setBaseWalkSpeed() Unable to resolve the object(%s) to a CreatureObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1505,7 +1505,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getBaseWalkSpeed(JNIEnv * /*env
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
return (creatureObject != NULL) ? creatureObject->getBaseWalkSpeed() : 0.0f;
|
||||
return (creatureObject != nullptr) ? creatureObject->getBaseWalkSpeed() : 0.0f;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1515,7 +1515,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setBaseRunSpeed(JNIEnv * /*env*/,
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
if (creatureObject == NULL)
|
||||
if (creatureObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setBaseRunSpeed() Unable to resolve the object(%s) to a CreatureObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1533,7 +1533,7 @@ jfloat JNICALL ScriptMethodsObjectMoveNamespace::getBaseRunSpeed(JNIEnv * /*env*
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
return (creatureObject != NULL) ? creatureObject->getBaseRunSpeed() : 0.0f;
|
||||
return (creatureObject != nullptr) ? creatureObject->getBaseRunSpeed() : 0.0f;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1543,7 +1543,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setMovementWalk(JNIEnv * /*env*/,
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
if (creatureObject == NULL)
|
||||
if (creatureObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setMovementWalk() Unable to resolve the object(%s) to a CreatureObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1551,7 +1551,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setMovementWalk(JNIEnv * /*env*/,
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(creatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setMovementWalk() Unable to resolve the object's(%s) controller to an AiCreatureController.", creatureObject->getDebugInformation().c_str()));
|
||||
return;
|
||||
@@ -1569,7 +1569,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setMovementRun(JNIEnv * /*env*/,
|
||||
NetworkId const networkId(object);
|
||||
CreatureObject * const creatureObject = CreatureObject::getCreatureObject(networkId);
|
||||
|
||||
if (creatureObject == NULL)
|
||||
if (creatureObject == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setMovementRun() Unable to resolve the object(%s) to a CreatureObject.", networkId.getValueString().c_str()));
|
||||
return;
|
||||
@@ -1577,7 +1577,7 @@ void JNICALL ScriptMethodsObjectMoveNamespace::setMovementRun(JNIEnv * /*env*/,
|
||||
|
||||
AICreatureController * const aiCreatureController = AICreatureController::asAiCreatureController(creatureObject->getController());
|
||||
|
||||
if (aiCreatureController == NULL)
|
||||
if (aiCreatureController == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsObjectMove::setMovementRun() Unable to resolve the object's(%s) controller to an AiCreatureController.", creatureObject->getDebugInformation().c_str()));
|
||||
return;
|
||||
|
||||
@@ -85,7 +85,7 @@ jobjectArray JNICALL ScriptMethodsPermissionsNamespace::permissionsGetBanned(JNI
|
||||
{
|
||||
ServerObject *serverObj = 0;
|
||||
if (!JavaLibrary::getObject(target, serverObj))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalObjectArrayRefPtr strArray;
|
||||
BuildingObject *buildingObj = dynamic_cast<BuildingObject*>(serverObj);
|
||||
@@ -96,7 +96,7 @@ jobjectArray JNICALL ScriptMethodsPermissionsNamespace::permissionsGetBanned(JNI
|
||||
if (cellObj)
|
||||
if (ScriptConversion::convert(cellObj->getBanned(), strArray))
|
||||
return strArray->getReturnValue();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -114,7 +114,7 @@ jobjectArray JNICALL ScriptMethodsPermissionsNamespace::permissionsGetAllowed(JN
|
||||
{
|
||||
ServerObject *serverObj = 0;
|
||||
if (!JavaLibrary::getObject(target, serverObj))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalObjectArrayRefPtr strArray;
|
||||
BuildingObject *buildingObj = dynamic_cast<BuildingObject*>(serverObj);
|
||||
@@ -125,7 +125,7 @@ jobjectArray JNICALL ScriptMethodsPermissionsNamespace::permissionsGetAllowed(JN
|
||||
if (cellObj)
|
||||
if (ScriptConversion::convert(cellObj->getAllowed(), strArray))
|
||||
return strArray->getReturnValue();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -177,7 +177,7 @@ jint JNICALL ScriptMethodsPilotNamespace::spaceUnitGetBehavior(JNIEnv * env, job
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetBehavior() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -200,7 +200,7 @@ jlong JNICALL ScriptMethodsPilotNamespace::spaceUnitGetPrimaryAttackTarget(JNIEn
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetPrimaryAttackTarget() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -223,7 +223,7 @@ jlongArray JNICALL ScriptMethodsPilotNamespace::spaceUnitGetAttackTargetList(JNI
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetAttackTargetList() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -311,7 +311,7 @@ jboolean JNICALL ScriptMethodsPilotNamespace::spaceUnitIsAttacking(JNIEnv * env,
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitIsAttacking() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -334,7 +334,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitIdle(JNIEnv * env, jobject /*
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitIdle() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -357,14 +357,14 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitTrack(JNIEnv * env, jobject /
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitTrack() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
Object * target = NULL;
|
||||
Object * target = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_target, target))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitTrack() The target did not resolve to an Object"));
|
||||
@@ -387,7 +387,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitMoveTo(JNIEnv * env, jobject
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitMoveTo() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -410,7 +410,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitMoveTo(JNIEnv * env, jobject
|
||||
return;
|
||||
}
|
||||
|
||||
SpacePath * const path = SpacePathManager::fetch(NULL, aiShipController->getOwner(), aiShipController->getShipRadius());
|
||||
SpacePath * const path = SpacePathManager::fetch(nullptr, aiShipController->getOwner(), aiShipController->getShipRadius());
|
||||
AiShipController::TransformList::const_iterator iterTransformList = convertedPath.begin();
|
||||
|
||||
for (; iterTransformList != convertedPath.end(); ++iterTransformList)
|
||||
@@ -435,7 +435,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitAddPatrolPath(JNIEnv * env, j
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitAddPatrolPath() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -483,7 +483,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitClearPatrolPath(JNIEnv * env,
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitClearPatrolPath() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -506,14 +506,14 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitFollow(JNIEnv * env, jobject
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitFollow() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
Object * followedUnit = NULL;
|
||||
Object * followedUnit = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_followedUnit, followedUnit))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitFollow() followedUnit did not resolve to an Object"));
|
||||
@@ -592,10 +592,10 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitAddDamageTaken(JNIEnv * env,
|
||||
}
|
||||
|
||||
ShipController * const shipController = shipObject->getController()->asShipController();
|
||||
AiShipController * const aiShipController = (shipController != NULL) ? shipController->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipController != nullptr) ? shipController->asAiShipController() : nullptr;
|
||||
bool const verifyAttacker = true;
|
||||
|
||||
if (aiShipController != NULL)
|
||||
if (aiShipController != nullptr)
|
||||
{
|
||||
// This adds damage to an AI unit
|
||||
|
||||
@@ -607,7 +607,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitAddDamageTaken(JNIEnv * env,
|
||||
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("ScriptMethodsPilot::spaceUnitAddDamageTaken() targetUnit(%s) is not attackable", targetShipObject->getNetworkId().getValueString().c_str()));
|
||||
}
|
||||
}
|
||||
else if (shipController != NULL)
|
||||
else if (shipController != nullptr)
|
||||
{
|
||||
// This adds damage to a player unit
|
||||
|
||||
@@ -635,7 +635,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitSetAttackOrders(JNIEnv * env,
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitSetAttackOrder() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -665,7 +665,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitSetPilotType(JNIEnv * env, jo
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitSetPilotType() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -697,13 +697,13 @@ jstring JNICALL ScriptMethodsPilotNamespace::spaceUnitGetPilotType(JNIEnv * env,
|
||||
LOGC(ConfigServerGame::isSpaceAiLoggingEnabled(), "debug_ai", ("ScriptMethodsPilot::spaceUnitGetPilotType()"));
|
||||
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipObject * const shipObject = JavaLibrary::getShipThrow(env, jobject_unit, "ScriptMethodsPilot::spaceUnitGetPilotType() unit did not resolve to a ShipObject");
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetPilotType() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -726,7 +726,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitRemoveAttackTarget(JNIEnv * e
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitRemoveAttackTarget() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -765,7 +765,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitSetLeashDistance(JNIEnv * env
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitSetLeashDistance() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -805,7 +805,7 @@ jint JNICALL ScriptMethodsPilotNamespace::spaceUnitGetSquadId(JNIEnv * env, jobj
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetSquadId() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -849,7 +849,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceSquadMoveTo(JNIEnv * /*env*/, job
|
||||
}
|
||||
|
||||
float const largestShipRadius = squad->getLargestShipRadius();
|
||||
SpacePath * const path = SpacePathManager::fetch(NULL, squad, largestShipRadius);
|
||||
SpacePath * const path = SpacePathManager::fetch(nullptr, squad, largestShipRadius);
|
||||
AiShipController::TransformList::const_iterator iterTransformList = convertedPath.begin();
|
||||
|
||||
for (; iterTransformList != convertedPath.end(); ++iterTransformList)
|
||||
@@ -936,7 +936,7 @@ jint JNICALL ScriptMethodsPilotNamespace::spaceSquadRemoveUnit(JNIEnv * env, job
|
||||
if (!shipObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceSquadRemoveUnit() called on unit(%s) without AiShipController", shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -1148,7 +1148,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceSquadTrack(JNIEnv * /*env*/, jobj
|
||||
return;
|
||||
}
|
||||
|
||||
Object * target = NULL;
|
||||
Object * target = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_target, target))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceSquadTrack() The target did not resolve to an Object"));
|
||||
@@ -1171,7 +1171,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceSquadSetLeader(JNIEnv * env, jobj
|
||||
if (!leaderShipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (leaderShipObject->getController()->asShipController() != NULL) ? leaderShipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (leaderShipObject->getController()->asShipController() != nullptr) ? leaderShipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceSquadSetLeader() called on unit(%s) without AiShipController", leaderShipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -1251,7 +1251,7 @@ void JNICALL ScriptMethodsPilotNamespace::spaceSquadFollow(JNIEnv * /*env*/, job
|
||||
return;
|
||||
}
|
||||
|
||||
Object * followedUnit = NULL;
|
||||
Object * followedUnit = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_followedUnit, followedUnit))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceSquadFollow() followedUnit did not resolve to an Object"));
|
||||
@@ -1418,7 +1418,7 @@ jint JNICALL ScriptMethodsPilotNamespace::spaceSquadGetGuardTarget(JNIEnv * /*en
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if (squad->getGuardTarget() == NULL)
|
||||
if (squad->getGuardTarget() == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ void JNICALL ScriptMethodsPilotNamespace::setShipAggroDistance(JNIEnv * env, job
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != NULL) ? shipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const aiShipController = (shipObject->getController()->asShipController() != nullptr) ? shipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!aiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::setShipAggroDistance(): unit(%s) does not have an AiShipController",shipObject->getNetworkId().getValueString().c_str()));
|
||||
@@ -1557,14 +1557,14 @@ jobject JNICALL ScriptMethodsPilotNamespace::spaceUnitGetDockTransform(JNIEnv *
|
||||
if (!verifyShipsEnabled())
|
||||
return 0;
|
||||
|
||||
Object * dockTarget = NULL;
|
||||
Object * dockTarget = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_dockTarget, dockTarget))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetDockTransform() dockTarget did not resolve to an Object"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Object * dockingUnit = NULL;
|
||||
Object * dockingUnit = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_dockingUnit, dockingUnit))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitGetDockTransform() dockingUnit did not resolve to an Object"));
|
||||
@@ -1600,14 +1600,14 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitAddExclusiveAggro(JNIEnv * en
|
||||
return;
|
||||
}
|
||||
|
||||
AiShipController * const unitAiShipController = (unitShipObject->getController()->asShipController() != NULL) ? unitShipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const unitAiShipController = (unitShipObject->getController()->asShipController() != nullptr) ? unitShipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!unitAiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitAddExclusiveAggro() called on unit(%s) without AiShipController", unitShipObject->getDebugInformation().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
Object * pilotObject = NULL;
|
||||
Object * pilotObject = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_pilot, pilotObject))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitAddExclusiveAggro() pilot did not resolve to an Object"));
|
||||
@@ -1642,14 +1642,14 @@ void JNICALL ScriptMethodsPilotNamespace::spaceUnitRemoveExclusiveAggro(JNIEnv *
|
||||
return;
|
||||
}
|
||||
|
||||
AiShipController * const unitAiShipController = (unitShipObject->getController()->asShipController() != NULL) ? unitShipObject->getController()->asShipController()->asAiShipController() : NULL;
|
||||
AiShipController * const unitAiShipController = (unitShipObject->getController()->asShipController() != nullptr) ? unitShipObject->getController()->asShipController()->asAiShipController() : nullptr;
|
||||
if (!unitAiShipController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitRemoveExclusiveAggro() called on unit(%s) without AiShipController", unitShipObject->getDebugInformation().c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
Object * pilotObject = NULL;
|
||||
Object * pilotObject = nullptr;
|
||||
if (!JavaLibrary::getObject(jobject_pilot, pilotObject))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("ScriptMethodsPilot::spaceUnitRemoveExclusiveAggro() pilot did not resolve to an Object"));
|
||||
|
||||
@@ -127,7 +127,7 @@ jlong JNICALL ScriptMethodsPlayerAccountNamespace::getPlayerObject(JNIEnv *env,
|
||||
|
||||
jlong objId = 0;
|
||||
|
||||
ServerObject * creatureServerObject = NULL;
|
||||
ServerObject * creatureServerObject = nullptr;
|
||||
if (JavaLibrary::getObject(creature,creatureServerObject))
|
||||
{
|
||||
SlotId slot = SlotIdManager::findSlotId(ConstCharCrcLowerString("ghost"));
|
||||
@@ -258,11 +258,11 @@ jobject JNICALL ScriptMethodsPlayerAccountNamespace::getAccountTimeData(JNIEnv *
|
||||
|
||||
const PlayerObject * player = PlayerCreatureController::getPlayerObject(
|
||||
creature);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return 0;
|
||||
|
||||
const Client * client = creature->getClient();
|
||||
if (client == NULL)
|
||||
if (client == nullptr)
|
||||
return 0;
|
||||
|
||||
// get the values that came from Platform
|
||||
@@ -463,7 +463,7 @@ jboolean JNICALL ScriptMethodsPlayerAccountNamespace::isAccountQualifiedForHouse
|
||||
* @returns a dictionary that contains the following data in paralled arrays
|
||||
* with the oldest CTS transaction first and the newest CTS transaction last
|
||||
*
|
||||
* @returns null if the character doesn't have any CTS history
|
||||
* @returns nullptr if the character doesn't have any CTS history
|
||||
*
|
||||
* string[] character_name full name of the source character
|
||||
* string[] cluster_name name of the source cluster
|
||||
@@ -471,7 +471,7 @@ jboolean JNICALL ScriptMethodsPlayerAccountNamespace::isAccountQualifiedForHouse
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsPlayerAccountNamespace::getCharacterCtsHistory(JNIEnv * env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject const * playerObject = NULL;
|
||||
CreatureObject const * playerObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerObject))
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::getCharacterCtsHistory: bad player object"));
|
||||
@@ -491,7 +491,7 @@ jobject JNICALL ScriptMethodsPlayerAccountNamespace::getCharacterCtsHistory(JNIE
|
||||
if (i.getValue(ctsTransactionDetail))
|
||||
{
|
||||
Unicode::UnicodeStringVector tokens;
|
||||
if (Unicode::tokenize(ctsTransactionDetail, tokens, NULL, NULL) && (tokens.size() >= 4))
|
||||
if (Unicode::tokenize(ctsTransactionDetail, tokens, nullptr, nullptr) && (tokens.size() >= 4))
|
||||
{
|
||||
Unicode::String * characterName = new Unicode::String();
|
||||
for (size_t i = 3, j = tokens.size(); i < j; ++i)
|
||||
@@ -538,13 +538,13 @@ jobject JNICALL ScriptMethodsPlayerAccountNamespace::getCharacterCtsHistory(JNIE
|
||||
* for the particular CTS source character that this character at one time transferred from
|
||||
* with the oldest CTS transaction first and the newest CTS transaction last
|
||||
*
|
||||
* @returns null if the character doesn't have any retroactive CTS objvars history
|
||||
* @returns nullptr if the character doesn't have any retroactive CTS objvars history
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsPlayerAccountNamespace::getCharacterRetroactiveCtsObjvars(JNIEnv * env, jobject self, jlong player)
|
||||
{
|
||||
std::vector<std::vector<std::pair<std::string, DynamicVariable> > const *> const & characterRetroactiveCtsObjvars = GameServer::getRetroactiveCtsHistoryObjvars(NetworkId(static_cast<NetworkId::NetworkIdType>(player)));
|
||||
if (characterRetroactiveCtsObjvars.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalObjectArrayRefPtr results = createNewObjectArray(characterRetroactiveCtsObjvars.size(), JavaLibrary::getClsDictionary());
|
||||
for (size_t i = 0, size = characterRetroactiveCtsObjvars.size(); i < size; ++i)
|
||||
@@ -603,7 +603,7 @@ jobjectArray JNICALL ScriptMethodsPlayerAccountNamespace::qualifyForFreeCts(JNIE
|
||||
// see if we can/should bypass the free CTS time restriction
|
||||
if (!freeCtsInfo && ConfigServerGame::getAllowIgnoreFreeCtsTimeRestriction())
|
||||
{
|
||||
CreatureObject const * playerObject = NULL;
|
||||
CreatureObject const * playerObject = nullptr;
|
||||
if (JavaLibrary::getObject(player, playerObject) && playerObject && playerObject->getClient() && playerObject->getClient()->isGod())
|
||||
{
|
||||
freeCtsInfo = FreeCtsDataTable::getFreeCtsInfoForCharacter(characterCreateTime, GameServer::getInstance().getClusterName(), true);
|
||||
@@ -615,7 +615,7 @@ jobjectArray JNICALL ScriptMethodsPlayerAccountNamespace::qualifyForFreeCts(JNIE
|
||||
}
|
||||
|
||||
if (!freeCtsInfo || freeCtsInfo->targetCluster.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalObjectArrayRefPtr valueArray = createNewObjectArray(freeCtsInfo->targetCluster.size(), JavaLibrary::getClsString());
|
||||
|
||||
@@ -634,7 +634,7 @@ jobjectArray JNICALL ScriptMethodsPlayerAccountNamespace::qualifyForFreeCts(JNIE
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::validateFreeCts(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring destinationGalaxy, jstring destinationCharacterName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::validateFreeCts: bad CreatureObject"));
|
||||
@@ -674,7 +674,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateFreeCts(JNIEnv * /*env
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::performFreeCts(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring destinationGalaxy, jstring destinationCharacterName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::performFreeCts: bad CreatureObject"));
|
||||
@@ -713,7 +713,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::performFreeCts(JNIEnv * /*env*
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::validateCts(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring destinationGalaxy, jstring destinationCharacterName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::validateCts: bad CreatureObject"));
|
||||
@@ -753,7 +753,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateCts(JNIEnv * /*env*/,
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::performCts(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring destinationGalaxy, jstring destinationCharacterName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::performCts: bad CreatureObject"));
|
||||
@@ -792,7 +792,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::performCts(JNIEnv * /*env*/, j
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv *env, jobject self, jlong player, jstring newName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::validateRenameCharacter: bad CreatureObject"));
|
||||
@@ -819,7 +819,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv
|
||||
bool lastNameChangeOnly = false;
|
||||
static Unicode::String const delimiters(Unicode::narrowToWide(" "));
|
||||
Unicode::UnicodeStringVector newNameTokens;
|
||||
if (!Unicode::tokenize(newNameString, newNameTokens, &delimiters, NULL))
|
||||
if (!Unicode::tokenize(newNameString, newNameTokens, &delimiters, nullptr))
|
||||
newNameTokens.clear();
|
||||
|
||||
size_t const newNameTokensCount = newNameTokens.size();
|
||||
@@ -846,7 +846,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv
|
||||
{
|
||||
Unicode::String const uniqueRandomName = NameManager::getInstance().generateUniqueRandomName(ConfigServerGame::getCharacterNameGeneratorDirectory(), creatureTemplate->getNameGeneratorType());
|
||||
Unicode::UnicodeStringVector uniqueRandomNameTokens;
|
||||
if (!Unicode::tokenize(uniqueRandomName, uniqueRandomNameTokens, &delimiters, NULL))
|
||||
if (!Unicode::tokenize(uniqueRandomName, uniqueRandomNameTokens, &delimiters, nullptr))
|
||||
uniqueRandomNameTokens.clear();
|
||||
|
||||
newNameString = ((uniqueRandomNameTokens.size() >= 1) ? uniqueRandomNameTokens[0] : delimiters) + delimiters + newNameTokens[1];
|
||||
@@ -861,7 +861,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv
|
||||
params.addParam("@ui:name_declined_racially_inappropriate", "reason");
|
||||
ScriptDictionaryPtr dictionary;
|
||||
GameScriptObject::makeScriptDictionary(params, dictionary);
|
||||
if (dictionary.get() != NULL)
|
||||
if (dictionary.get() != nullptr)
|
||||
{
|
||||
dictionary->serialize();
|
||||
MessageToQueue::getInstance().sendMessageToJava(creatureObject->getNetworkId(), "renameCharacterNameValidationFail", dictionary->getSerializedData(), 0, false);
|
||||
@@ -879,7 +879,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv
|
||||
params.addParam(errorText.c_str(), "reason");
|
||||
ScriptDictionaryPtr dictionary;
|
||||
GameScriptObject::makeScriptDictionary(params, dictionary);
|
||||
if (dictionary.get() != NULL)
|
||||
if (dictionary.get() != nullptr)
|
||||
{
|
||||
dictionary->serialize();
|
||||
MessageToQueue::getInstance().sendMessageToJava(creatureObject->getNetworkId(), "renameCharacterNameValidationFail", dictionary->getSerializedData(), 0, false);
|
||||
@@ -906,7 +906,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::validateRenameCharacter(JNIEnv
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::renameCharacterReleaseNameReservation(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::renameCharacterReleaseNameReservation: bad CreatureObject"));
|
||||
@@ -929,7 +929,7 @@ void JNICALL ScriptMethodsPlayerAccountNamespace::renameCharacterReleaseNameRese
|
||||
*/
|
||||
void JNICALL ScriptMethodsPlayerAccountNamespace::renameCharacter(JNIEnv *env, jobject self, jlong player, jstring newName)
|
||||
{
|
||||
CreatureObject const * creatureObject = NULL;
|
||||
CreatureObject const * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
{
|
||||
DEBUG_WARNING(true, ("JavaLibrary::renameCharacter: bad CreatureObject"));
|
||||
|
||||
@@ -159,7 +159,7 @@ jboolean ScriptMethodsPlayerQuestNamespace::addPlayerQuestTask(JNIEnv * env, job
|
||||
std::string sceneId;
|
||||
if (!ScriptConversion::convertWorld(waypointLocation, waypointVec, sceneId))
|
||||
{
|
||||
// NULL or Invalid Location passed in. That's fine, just means no waypoint.
|
||||
// nullptr or Invalid Location passed in. That's fine, just means no waypoint.
|
||||
if(questObject)
|
||||
{
|
||||
std::string titleString;
|
||||
@@ -456,7 +456,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestWaypoint(JNIEnv * env,
|
||||
if(!JavaLibrary::getObject(quest, questObject))
|
||||
{
|
||||
WARNING(true, ("getPlayerQuestWaypoint: Could not get valid Player Quest Object from OID: %d", quest));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(questObject)
|
||||
@@ -465,7 +465,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestWaypoint(JNIEnv * env,
|
||||
return jString.getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -520,7 +520,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTitle(JNIEnv * env, job
|
||||
if(!JavaLibrary::getObject(quest, questObject))
|
||||
{
|
||||
WARNING(true, ("getPlayerQuestTitle: Could not get valid Player Quest Object from OID: %d", quest));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(questObject)
|
||||
@@ -529,7 +529,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTitle(JNIEnv * env, job
|
||||
return returnVal.getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestDescription(JNIEnv * env, jobject self, jlong quest)
|
||||
@@ -541,7 +541,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestDescription(JNIEnv * en
|
||||
if(!JavaLibrary::getObject(quest, questObject))
|
||||
{
|
||||
WARNING(true, ("getPlayerQuestDescription: Could not get valid Player Quest Object from OID: %d", quest));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(questObject)
|
||||
@@ -550,7 +550,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestDescription(JNIEnv * en
|
||||
return returnVal.getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskTitle(JNIEnv * env, jobject self, jlong quest, jint index)
|
||||
@@ -562,7 +562,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskTitle(JNIEnv * env,
|
||||
if(!JavaLibrary::getObject(quest, questObject))
|
||||
{
|
||||
WARNING(true, ("getPlayerQuestTaskTitle: Could not get valid Player Quest Object from OID: %d", quest));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(questObject)
|
||||
@@ -571,7 +571,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskTitle(JNIEnv * env,
|
||||
return returnVal.getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskDescription(JNIEnv * env, jobject self, jlong quest, jint index)
|
||||
@@ -583,7 +583,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskDescription(JNIEnv
|
||||
if(!JavaLibrary::getObject(quest, questObject))
|
||||
{
|
||||
WARNING(true, ("getPlayerQuestTaskDescription: Could not get valid Player Quest Object from OID: %d", quest));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if(questObject)
|
||||
@@ -592,7 +592,7 @@ jobject ScriptMethodsPlayerQuestNamespace::getPlayerQuestTaskDescription(JNIEnv
|
||||
return returnVal.getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ScriptMethodsPlayerQuestNamespace::setPlayerQuestRecipe(JNIEnv * env, jobject self, jlong quest, jboolean recipe)
|
||||
@@ -768,21 +768,21 @@ void ScriptMethodsPlayerQuestNamespace::openPlayerQuestRecipe(JNIEnv * env, jobj
|
||||
UNREF(env);
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature))
|
||||
{
|
||||
DEBUG_WARNING(true, ("openPlayerQuestRecipe: Failed to get valid creature object with OID %d", player));
|
||||
return;
|
||||
}
|
||||
|
||||
ServerObject * recipeObj = NULL;
|
||||
ServerObject * recipeObj = nullptr;
|
||||
if (!JavaLibrary::getObject(recipe, recipeObj))
|
||||
{
|
||||
DEBUG_WARNING(true, ("openPlayerQuestRecipe: Failed to get valid recipe object with OID %d", player));
|
||||
return;
|
||||
}
|
||||
|
||||
if (playerCreature->isPlayerControlled() && playerCreature->getController() != NULL)
|
||||
if (playerCreature->isPlayerControlled() && playerCreature->getController() != nullptr)
|
||||
{
|
||||
playerCreature->getController()->appendMessage(
|
||||
static_cast<int>(CM_openRecipe),
|
||||
@@ -801,7 +801,7 @@ void ScriptMethodsPlayerQuestNamespace::resetAllPlayerQuestData(JNIEnv * env, jo
|
||||
UNREF(env);
|
||||
UNREF(self);
|
||||
|
||||
PlayerQuestObject * playerQuest = NULL;
|
||||
PlayerQuestObject * playerQuest = nullptr;
|
||||
if (!JavaLibrary::getObject(quest, playerQuest))
|
||||
{
|
||||
DEBUG_WARNING(true, ("resetAllPlayerQuestData: Failed to get valid recipe object with OID %d", quest));
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace ScriptMethodsPvpNamespace
|
||||
|
||||
const char * makeCopyOfString(const char * rhs)
|
||||
{
|
||||
char * lhs = NULL;
|
||||
char * lhs = nullptr;
|
||||
if (rhs)
|
||||
{
|
||||
lhs = new char[strlen(rhs) + 1];
|
||||
@@ -668,7 +668,7 @@ jobjectArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemyFlags(JNIEnv *env, jo
|
||||
if (ScriptConversion::convert(enemyStrings, strArray))
|
||||
return strArray->getReturnValue();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -749,7 +749,7 @@ jboolean JNICALL ScriptMethodsPvpNamespace::pvpHasBattlefieldEnemyFlag(JNIEnv *e
|
||||
* @param actor The actor for the enemy check
|
||||
* @param from The center of the range
|
||||
* @param range The distance to query.
|
||||
* @return null if there is an error, or an array of enemy objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of enemy objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInRange(JNIEnv *env, jobject self, jlong actor, jlong location, jfloat range)
|
||||
{
|
||||
@@ -799,7 +799,7 @@ jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInRange(JNIEnv *env,
|
||||
* @param angle The cone angle, in degrees, that the cone sweeps out. The
|
||||
* total cone angle is twice this angle; therefore, this angle
|
||||
* represents the angle swept out to each side of the cone axis.
|
||||
* @return null if there is an error, or an array of enemy objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of enemy objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInCone(JNIEnv *env, jobject self, jlong actor, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -853,7 +853,7 @@ jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInCone(JNIEnv *env, j
|
||||
* @param angle The cone angle, in degrees, that the cone sweeps out. The
|
||||
* total cone angle is twice this angle; therefore, this angle
|
||||
* represents the angle swept out to each side of the cone axis.
|
||||
* @return null if there is an error, or an array of enemy objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of enemy objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInConeLocation(JNIEnv *env, jobject self, jlong actor, jlong coneCenterObjectId, jobject coneDirectionLocation, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -900,7 +900,7 @@ jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetEnemiesInConeLocation(JNIEnv
|
||||
* @param actor The actor for the canAttack check
|
||||
* @param from The center of the range
|
||||
* @param range The distance to query.
|
||||
* @return null if there is an error, or an array of attackable objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of attackable objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetTargetsInRange(JNIEnv *env, jobject self, jlong actor, jlong location, jfloat range)
|
||||
{
|
||||
@@ -951,7 +951,7 @@ jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetTargetsInRange(JNIEnv *env,
|
||||
* @param angle The cone angle, in degrees, that the cone sweeps out. The
|
||||
* total cone angle is twice this angle; therefore, this angle
|
||||
* represents the angle swept out to each side of the cone axis.
|
||||
* @return null if there is an error, or an array of attackable objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of attackable objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetTargetsInCone(JNIEnv *env, jobject self, jlong actor, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -1005,7 +1005,7 @@ jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetTargetsInCone(JNIEnv *env, j
|
||||
* @param angle The cone angle, in degrees, that the cone sweeps out. The
|
||||
* total cone angle is twice this angle; therefore, this angle
|
||||
* represents the angle swept out to each side of the cone axis.
|
||||
* @return null if there is an error, or an array of attackable objects which are in range.
|
||||
* @return nullptr if there is an error, or an array of attackable objects which are in range.
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsPvpNamespace::pvpGetTargetsInConeLocation(JNIEnv *env, jobject self, jlong actor, jlong coneCenterObjectId, jobject coneDirectionLocation, jfloat range, jfloat angle)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ScriptMethodsQuestNamespace
|
||||
{
|
||||
PlayerObject * getPlayerForCharacter(jlong playerCreatureId)
|
||||
{
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerCreatureId, playerCreature))
|
||||
{
|
||||
return PlayerCreatureController::getPlayerObject(playerCreature);
|
||||
@@ -44,7 +44,7 @@ namespace ScriptMethodsQuestNamespace
|
||||
{
|
||||
NetworkId id(playerCreatureId);
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("Requested player %s, who could not be found.", id.getValueString().c_str()));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,8 +397,8 @@ void JNICALL ScriptMethodsQuestNamespace::questSetQuestTaskCounter(JNIEnv *env,
|
||||
}
|
||||
|
||||
PlayerObject * const playerObject = getPlayerForCharacter(playerId);
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : NULL;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : NULL;
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : nullptr;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : nullptr;
|
||||
if(!controller)
|
||||
return;
|
||||
|
||||
@@ -427,8 +427,8 @@ void JNICALL ScriptMethodsQuestNamespace::questSetQuestTaskLocation(JNIEnv *env,
|
||||
}
|
||||
|
||||
PlayerObject * const playerObject = getPlayerForCharacter(playerId);
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : NULL;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : NULL;
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : nullptr;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : nullptr;
|
||||
if(!controller)
|
||||
return;
|
||||
|
||||
@@ -456,8 +456,8 @@ void JNICALL ScriptMethodsQuestNamespace::questSetQuestTaskTimer(JNIEnv *env, jo
|
||||
}
|
||||
|
||||
PlayerObject * const playerObject = getPlayerForCharacter(playerId);
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : NULL;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : NULL;
|
||||
CreatureObject * const creatureObject = playerObject ? playerObject->getCreatureObject() : nullptr;
|
||||
Controller * const controller = creatureObject ? creatureObject->getController() : nullptr;
|
||||
if(!controller)
|
||||
return;
|
||||
|
||||
@@ -487,7 +487,7 @@ void JNICALL ScriptMethodsQuestNamespace::requestActivateQuest(JNIEnv * env, job
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerId, playerCreature) && playerCreature)
|
||||
{
|
||||
Quest const * const q = QuestManager::getQuest(questCrc);
|
||||
@@ -557,7 +557,7 @@ void JNICALL ScriptMethodsQuestNamespace::requestCompleteQuest(JNIEnv * env, job
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerId, playerCreature) && playerCreature)
|
||||
{
|
||||
Quest const * const q = QuestManager::getQuest(questCrc);
|
||||
@@ -576,14 +576,14 @@ void JNICALL ScriptMethodsQuestNamespace::showCyberneticsPage(JNIEnv *env, jobje
|
||||
{
|
||||
MessageQueueCyberneticsOpen::OpenType const type = static_cast<MessageQueueCyberneticsOpen::OpenType>(openType);
|
||||
|
||||
CreatureObject * npc = NULL;
|
||||
CreatureObject * npc = nullptr;
|
||||
if (!JavaLibrary::getObject(npcId, npc))
|
||||
return;
|
||||
|
||||
if(!npc)
|
||||
return;
|
||||
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerId, playerCreature))
|
||||
{
|
||||
Controller * const playerController = playerCreature->getController();
|
||||
@@ -659,7 +659,7 @@ void JNICALL ScriptMethodsQuestNamespace::sendStaticItemDataToPlayer(JNIEnv *env
|
||||
}
|
||||
|
||||
//send to player
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerId, playerCreature))
|
||||
{
|
||||
Controller * const playerController = playerCreature->getController();
|
||||
@@ -683,7 +683,7 @@ void JNICALL ScriptMethodsQuestNamespace::showLootBox(JNIEnv *env, jobject self,
|
||||
return;
|
||||
|
||||
//send to player
|
||||
CreatureObject * playerCreature = NULL;
|
||||
CreatureObject * playerCreature = nullptr;
|
||||
if (JavaLibrary::getObject(playerId, playerCreature))
|
||||
{
|
||||
Controller * const playerController = playerCreature->getController();
|
||||
|
||||
@@ -115,7 +115,7 @@ LocalObjectArrayRefPtr ScriptMethodsRegionNamespace::_getRegionsAtPoint(jobject
|
||||
std::vector<const Region *> result;
|
||||
RegionMaster::getRegionsAtPoint(sceneId, locationVec.x, locationVec.z, result);
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return LocalObjectArrayRef::cms_nullPtr;
|
||||
|
||||
@@ -127,7 +127,7 @@ LocalObjectArrayRefPtr ScriptMethodsRegionNamespace::_getRegionsAtPoint(jobject
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if (!ScriptConversion::convert(*r, javaRegion))
|
||||
return LocalObjectArrayRef::cms_nullPtr;
|
||||
@@ -195,7 +195,7 @@ void JNICALL ScriptMethodsRegionNamespace::createCircleRegion(JNIEnv *env, jobje
|
||||
UNREF(self);
|
||||
|
||||
// validate scripter's input
|
||||
if (center == NULL || radius <= 0 || name == 0)
|
||||
if (center == nullptr || radius <= 0 || name == 0)
|
||||
return;
|
||||
|
||||
JavaStringParam jname(name);
|
||||
@@ -239,7 +239,7 @@ jobject JNICALL ScriptMethodsRegionNamespace::getRegion(JNIEnv *env, jobject sel
|
||||
return 0;
|
||||
|
||||
const Region * r = RegionMaster::getRegionByName(planetName, regionName);
|
||||
if (r == NULL)
|
||||
if (r == nullptr)
|
||||
return 0;
|
||||
|
||||
LocalRefPtr jr;
|
||||
@@ -255,7 +255,7 @@ jobject JNICALL ScriptMethodsRegionNamespace::getRegion(JNIEnv *env, jobject sel
|
||||
jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsAtPoint(JNIEnv *env, jobject self, jobject location)
|
||||
{
|
||||
LocalObjectArrayRefPtr regions = _getRegionsAtPoint(location);
|
||||
if (regions.get() == NULL)
|
||||
if (regions.get() == nullptr)
|
||||
return 0;
|
||||
return regions->getReturnValue();
|
||||
}
|
||||
@@ -279,9 +279,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegions(JNIEnv *env, jobje
|
||||
std::vector<const Region*> result;
|
||||
RegionMaster::getRegionsForPlanet(sceneId, result);
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -291,11 +291,11 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegions(JNIEnv *env, jobje
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *i;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if (!ScriptConversion::convert(*r, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
@@ -329,7 +329,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithPvP(JNIEnv *env
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -342,7 +342,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithPvP(JNIEnv *env
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -375,7 +375,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithBuildable(JNIEn
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -388,7 +388,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithBuildable(JNIEn
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -421,7 +421,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMunicipal(JNIEn
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -434,7 +434,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMunicipal(JNIEn
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -467,7 +467,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithGeographical(JN
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -480,7 +480,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithGeographical(JN
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -513,7 +513,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithDifficulty(JNIE
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -526,7 +526,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithDifficulty(JNIE
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -559,7 +559,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithSpawnable(JNIEn
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -572,7 +572,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithSpawnable(JNIEn
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -605,7 +605,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMission(JNIEnv
|
||||
goodRegions.push_back(*i);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (goodRegions.empty())
|
||||
return 0;
|
||||
|
||||
@@ -618,7 +618,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMission(JNIEnv
|
||||
LocalRefPtr javaRegion;
|
||||
if (!ScriptConversion::convert(**it, javaRegion))
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*result, index, *javaRegion);
|
||||
}
|
||||
@@ -657,7 +657,7 @@ jboolean JNICALL ScriptMethodsRegionNamespace::deleteRegion(JNIEnv *env, jobject
|
||||
return JNI_FALSE;
|
||||
|
||||
UniverseObject * regionObject = dynamic_cast<UniverseObject *>(r->getDynamicRegionId().getObject());
|
||||
if (regionObject == NULL)
|
||||
if (regionObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
regionObject->permanentlyDestroy(DeleteReasons::Script);
|
||||
return JNI_TRUE;
|
||||
@@ -711,7 +711,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionExtent(JNIEnv *env,
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
/** Find a random point in the given region
|
||||
* @return a script.location inside the region, or a null reference if any problems occur
|
||||
* @return a script.location inside the region, or a nullptr reference if any problems occur
|
||||
*/
|
||||
jobject JNICALL ScriptMethodsRegionNamespace::findPointInRegion(JNIEnv *env, jobject self, jobject region)
|
||||
{
|
||||
@@ -732,7 +732,7 @@ jobject JNICALL ScriptMethodsRegionNamespace::findPointInRegion(JNIEnv *env, job
|
||||
Vector loc3d(x, 0, z);
|
||||
LocalRefPtr location;
|
||||
if (!ScriptConversion::convert(loc3d, r->getPlanet(), NetworkId::cms_invalid, location))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return location->getReturnValue();
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithPvPAtPoint(JNIE
|
||||
{
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -760,9 +760,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithPvPAtPoint(JNIE
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -772,10 +772,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithPvPAtPoint(JNIE
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if (!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -790,7 +790,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithBuildableAtPoin
|
||||
{
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -806,9 +806,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithBuildableAtPoin
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -818,10 +818,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithBuildableAtPoin
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -837,7 +837,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMunicipalAtPoin
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::getRegionsWithMunicipalAtPoint");
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -853,9 +853,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMunicipalAtPoin
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -865,10 +865,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMunicipalAtPoin
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -884,7 +884,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithGeographicalAtP
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::getRegionsWithGeographicalAtPoint");
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -900,9 +900,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithGeographicalAtP
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -912,10 +912,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithGeographicalAtP
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -930,7 +930,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithDifficultyAtPoi
|
||||
{
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -946,9 +946,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithDifficultyAtPoi
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -958,10 +958,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithDifficultyAtPoi
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -976,7 +976,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithSpawnableAtPoin
|
||||
{
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -992,9 +992,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithSpawnableAtPoin
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -1004,10 +1004,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithSpawnableAtPoin
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -1022,7 +1022,7 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMissionAtPoint(
|
||||
{
|
||||
//get all the regions at the given point
|
||||
LocalObjectArrayRefPtr regionsAtPoint = _getRegionsAtPoint(location);
|
||||
if (regionsAtPoint.get() == NULL || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
if (regionsAtPoint.get() == nullptr || regionsAtPoint == LocalObjectArrayRef::cms_nullPtr)
|
||||
return 0;
|
||||
|
||||
//parse out the ones with the right property
|
||||
@@ -1038,9 +1038,9 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMissionAtPoint(
|
||||
result.push_back(r);
|
||||
}
|
||||
|
||||
//-- return null instead of a zero-length array
|
||||
//-- return nullptr instead of a zero-length array
|
||||
if (result.empty ())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
//put them into the jobjectarray
|
||||
LocalObjectArrayRefPtr regions = createNewObjectArray(result.size(), JavaLibrary::getClsRegion());
|
||||
@@ -1050,10 +1050,10 @@ jobjectArray JNICALL ScriptMethodsRegionNamespace::getRegionsWithMissionAtPoint(
|
||||
{
|
||||
LocalRefPtr javaRegion;
|
||||
const Region * r = *it;
|
||||
if (r != NULL)
|
||||
if (r != nullptr)
|
||||
{
|
||||
if(!ScriptConversion::convert(*r, javaRegion))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
setObjectArrayElement(*regions, index, *javaRegion);
|
||||
}
|
||||
@@ -1072,16 +1072,16 @@ jobject JNICALL ScriptMethodsRegionNamespace::getSmallestRegionAtPoint(JNIEnv *e
|
||||
Vector locationVec;
|
||||
std::string sceneId;
|
||||
if(!ScriptConversion::convertWorld(location, locationVec, sceneId))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const Region * r = RegionMaster::getSmallestRegionAtPoint(sceneId, locationVec.x,
|
||||
locationVec.z);
|
||||
if (r == NULL)
|
||||
return NULL;
|
||||
if (r == nullptr)
|
||||
return nullptr;
|
||||
|
||||
LocalRefPtr region;
|
||||
if (!ScriptConversion::convert(*r, region))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return region->getReturnValue();
|
||||
}
|
||||
|
||||
@@ -1095,16 +1095,16 @@ jobject JNICALL ScriptMethodsRegionNamespace::getSmallestVisibleRegionAtPoint(JN
|
||||
Vector locationVec;
|
||||
std::string sceneId;
|
||||
if(!ScriptConversion::convertWorld(location, locationVec, sceneId))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const Region * r = RegionMaster::getSmallestVisibleRegionAtPoint(sceneId, locationVec.x,
|
||||
locationVec.z);
|
||||
if (r == NULL)
|
||||
return NULL;
|
||||
if (r == nullptr)
|
||||
return nullptr;
|
||||
|
||||
LocalRefPtr region;
|
||||
if (!ScriptConversion::convert(*r, region))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return region->getReturnValue();
|
||||
}
|
||||
|
||||
@@ -1140,7 +1140,7 @@ jlong JNICALL ScriptMethodsRegionNamespace::createCircleRegionWithSpawn(JNIEnv *
|
||||
UNREF(self);
|
||||
|
||||
// validate scripter's input
|
||||
if (center == NULL || radius <= 0 || name == 0)
|
||||
if (center == nullptr || radius <= 0 || name == 0)
|
||||
return 0;
|
||||
|
||||
JavaStringParam jname(name);
|
||||
|
||||
@@ -87,7 +87,7 @@ struct Region3dPtrVolumeComparator
|
||||
|
||||
ScriptParams *ScriptMethodsRegion3dNamespace::convertRegionDictionaryToScriptParams(jobject regionDictionary)
|
||||
{
|
||||
// If we're passed a null dictionary, we just don't have any extra data but
|
||||
// If we're passed a nullptr dictionary, we just don't have any extra data but
|
||||
// we still want to return a ScriptParams to fill in the standard values.
|
||||
if (!regionDictionary)
|
||||
return new ScriptParams;
|
||||
|
||||
@@ -459,7 +459,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceContainerForType(JNIE
|
||||
{
|
||||
ResourceTypeObject const * const typeObj = ServerUniverse::getInstance().getResourceTypeById(NetworkId(resourceType));
|
||||
if (!typeObj)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::string templateName;
|
||||
typeObj->getCrateTemplate(templateName);
|
||||
@@ -473,7 +473,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceName(JNIEnv * /*env*/
|
||||
{
|
||||
if (resourceType == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceName passed null resource type"));
|
||||
WARNING(true, ("JavaLibrary::getResourceName passed nullptr resource type"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getResourceNames(JNIEnv *en
|
||||
{
|
||||
if (resourceTypes == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceNames passed null resource types"));
|
||||
WARNING(true, ("JavaLibrary::getResourceNames passed nullptr resource types"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceClassName(JNIEnv *env
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceClassName passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getResourceClassName passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -531,7 +531,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceClassName(JNIEnv *env
|
||||
|
||||
const ServerResourceClassObject * resClass = safe_cast<const ServerResourceClassObject *>(
|
||||
ServerUniverse::getInstance().getResourceClassByName(resourceClassName));
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceClassName cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -547,7 +547,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getResourceClassNames(JNIEn
|
||||
{
|
||||
if (resourceClasses == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceClassNames passed null resource classes"));
|
||||
WARNING(true, ("JavaLibrary::getResourceClassNames passed nullptr resource classes"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -569,7 +569,7 @@ jlongArray JNICALL ScriptMethodsResourceNamespace::getResourceTypes(JNIEnv * env
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceTypes passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getResourceTypes passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ jlongArray JNICALL ScriptMethodsResourceNamespace::getResourceTypes(JNIEnv * env
|
||||
|
||||
const ServerResourceClassObject * resClass = safe_cast<const ServerResourceClassObject *>(
|
||||
ServerUniverse::getInstance().getResourceClassByName(resourceClassName));
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceTypes cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -604,7 +604,7 @@ jlongArray JNICALL ScriptMethodsResourceNamespace::getResourceTypes(JNIEnv * env
|
||||
jlong jlongTmp;
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if (types[i] != NULL)
|
||||
if (types[i] != nullptr)
|
||||
{
|
||||
jlongTmp = (types[i]->getNetworkId()).getValue();
|
||||
setLongArrayRegion(*jtypes, i, 1, &jlongTmp);
|
||||
@@ -619,7 +619,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceClass(JNIEnv * /*env*
|
||||
{
|
||||
if (resourceType == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceClass passed null resource type"));
|
||||
WARNING(true, ("JavaLibrary::getResourceClass passed nullptr resource type"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceParentClass(JNIEnv *
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceParentClass passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getResourceParentClass passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -655,14 +655,14 @@ jstring JNICALL ScriptMethodsResourceNamespace::getResourceParentClass(JNIEnv *
|
||||
}
|
||||
|
||||
const ResourceClassObject * resClass = ServerUniverse::getInstance().getResourceClassByName(resourceClassName);
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceParentClass cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
const ResourceClassObject * parentClass = resClass->getParent();
|
||||
if (parentClass == NULL)
|
||||
if (parentClass == nullptr)
|
||||
return 0;
|
||||
|
||||
JavaString parentClassName(parentClass->getResourceClassName());
|
||||
@@ -675,7 +675,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getResourceChildClasses(JNI
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceChildClasses passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getResourceChildClasses passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getResourceChildClasses(JNI
|
||||
}
|
||||
|
||||
const ResourceClassObject * resClass = ServerUniverse::getInstance().getResourceClassByName(resourceClassName);
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceChildClasses cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -701,7 +701,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getResourceChildClasses(JNI
|
||||
LocalObjectArrayRefPtr childrenArray = createNewObjectArray(static_cast<int>(count), JavaLibrary::getClsString());
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if (children[i] != NULL)
|
||||
if (children[i] != nullptr)
|
||||
{
|
||||
JavaString name(children[i]->getResourceClassName());
|
||||
setObjectArrayElement(*childrenArray, static_cast<int>(i), name);
|
||||
@@ -716,7 +716,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getImmediateResourceChildCl
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getImmediateResourceChildClasses passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getImmediateResourceChildClasses passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -729,7 +729,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getImmediateResourceChildCl
|
||||
}
|
||||
|
||||
const ResourceClassObject * resClass = ServerUniverse::getInstance().getResourceClassByName(resourceClassName);
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getImmediateResourceChildClasses cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -742,7 +742,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getImmediateResourceChildCl
|
||||
LocalObjectArrayRefPtr childrenArray = createNewObjectArray(count, JavaLibrary::getClsString());
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
if (children[i] != NULL)
|
||||
if (children[i] != nullptr)
|
||||
{
|
||||
JavaString name(children[i]->getResourceClassName());
|
||||
setObjectArrayElement(*childrenArray, i, name);
|
||||
@@ -757,7 +757,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getLeafResourceChildClasses
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getLeafResourceChildClasses passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::getLeafResourceChildClasses passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getLeafResourceChildClasses
|
||||
}
|
||||
|
||||
const ResourceClassObject * resClass = ServerUniverse::getInstance().getResourceClassByName(resourceClassName);
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getLeafResourceChildClasses cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -783,7 +783,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getLeafResourceChildClasses
|
||||
LocalObjectArrayRefPtr childrenArray = createNewObjectArray(count, JavaLibrary::getClsString());
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
if (children[i] != NULL)
|
||||
if (children[i] != nullptr)
|
||||
{
|
||||
JavaString name(children[i]->getResourceClassName());
|
||||
setObjectArrayElement(*childrenArray, i, name);
|
||||
@@ -798,7 +798,7 @@ jboolean JNICALL ScriptMethodsResourceNamespace::hasResourceType(JNIEnv *env, jo
|
||||
{
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::hasResourceType passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::hasResourceType passed nullptr resource class"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -811,7 +811,7 @@ jboolean JNICALL ScriptMethodsResourceNamespace::hasResourceType(JNIEnv *env, jo
|
||||
}
|
||||
|
||||
ServerResourceClassObject const * const resClass = safe_cast<ServerResourceClassObject const *>(ServerUniverse::getInstance().getResourceClassByName(resourceClassName));
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::hasResourceType cannot find resource class for %s", resourceClassName.c_str()));
|
||||
return JNI_FALSE;
|
||||
@@ -826,13 +826,13 @@ jlong JNICALL ScriptMethodsResourceNamespace::createResourceCrate(JNIEnv * /*env
|
||||
{
|
||||
if (resourceType == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate passed null resource type"));
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate passed nullptr resource type"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (destination == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate passed null destination"));
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate passed nullptr destination"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -849,7 +849,7 @@ jlong JNICALL ScriptMethodsResourceNamespace::createResourceCrate(JNIEnv * /*env
|
||||
return 0;
|
||||
}
|
||||
|
||||
ServerObject * container = NULL;
|
||||
ServerObject * container = nullptr;
|
||||
if (!JavaLibrary::getObject(destination, container))
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate cannot find destination object"));
|
||||
@@ -860,14 +860,14 @@ jlong JNICALL ScriptMethodsResourceNamespace::createResourceCrate(JNIEnv * /*env
|
||||
rt->getCrateTemplate(crateTemplateName);
|
||||
|
||||
ServerObject * object = ServerWorld::createNewObject(crateTemplateName, *container, true);
|
||||
if (object == NULL)
|
||||
if (object == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate cannot create crate from template %s", crateTemplateName.c_str()));
|
||||
return 0;
|
||||
}
|
||||
|
||||
ResourceContainerObject * crate = dynamic_cast<ResourceContainerObject *>(object);
|
||||
if (crate == NULL)
|
||||
if (crate == nullptr)
|
||||
{
|
||||
IGNORE_RETURN(object->permanentlyDestroy(DeleteReasons::SetupFailed));
|
||||
WARNING(true, ("JavaLibrary::createResourceCrate crate %s is not a resource container", crateTemplateName.c_str()));
|
||||
@@ -888,13 +888,13 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::requestResourceList(JNIEnv
|
||||
{
|
||||
if (loc == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::requestResourceList passed null location"));
|
||||
WARNING(true, ("JavaLibrary::requestResourceList passed nullptr location"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (resourceClass == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::requestResourceList passed null resource class"));
|
||||
WARNING(true, ("JavaLibrary::requestResourceList passed nullptr resource class"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -921,7 +921,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::requestResourceList(JNIEnv
|
||||
const Vector & locationPos = location.getCoordinates();
|
||||
|
||||
const PlanetObject * planet = ServerUniverse::getInstance().getPlanetByName(location.getSceneId());
|
||||
if (planet == NULL)
|
||||
if (planet == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::requestResourceList cannot find planet %s", location.getSceneId()));
|
||||
return 0;
|
||||
@@ -929,7 +929,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::requestResourceList(JNIEnv
|
||||
|
||||
// get the resource class and all its children
|
||||
ServerResourceClassObject const * const resClass = safe_cast<ServerResourceClassObject const *>(ServerUniverse::getInstance().getResourceClassByName(resourceClassName));
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::requestResourceList cannot find resource class %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -951,7 +951,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::requestResourceList(JNIEnv
|
||||
if (!(*i)->isDepleted())
|
||||
{
|
||||
ResourcePoolObject const * const pool = (*i)->getPoolForPlanet(*planet);
|
||||
if (pool != NULL)
|
||||
if (pool != nullptr)
|
||||
{
|
||||
float density = pool->getEfficiencyAtLocation(locationPos.x, locationPos.z);
|
||||
if (density >= minDensity && density <= maxDensity)
|
||||
@@ -1049,7 +1049,7 @@ jobjectArray JNICALL ScriptMethodsResourceNamespace::getScaledResourceAttributes
|
||||
return 0;
|
||||
}
|
||||
ServerResourceClassObject const * const resClass = safe_cast<ServerResourceClassObject const *>(ServerUniverse::getInstance().getResourceClassByName(resourceClassName));
|
||||
if (resClass == NULL)
|
||||
if (resClass == nullptr)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getScaledResourceAttributes cannot find resource class %s", resourceClassName.c_str()));
|
||||
return 0;
|
||||
@@ -1152,7 +1152,7 @@ jint JNICALL ScriptMethodsResourceNamespace::getResourceAttribute(JNIEnv * /*env
|
||||
|
||||
if (resourceType == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::getResourceAttribute passed null resource type"));
|
||||
WARNING(true, ("JavaLibrary::getResourceAttribute passed nullptr resource type"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1171,7 +1171,7 @@ jint JNICALL ScriptMethodsResourceNamespace::getResourceAttribute(JNIEnv * /*env
|
||||
jlong JNICALL ScriptMethodsResourceNamespace::getRecycledVersionOfResourceType(JNIEnv * /*env*/, jobject /*self*/, jlong resourceType)
|
||||
{
|
||||
ResourceTypeObject const * const resourceTypeObject = ServerUniverse::getInstance().getResourceTypeById(NetworkId(resourceType));
|
||||
ResourceTypeObject const * const recycledTypeObject = resourceTypeObject ? resourceTypeObject->getRecycledVersion() : NULL;
|
||||
ResourceTypeObject const * const recycledTypeObject = resourceTypeObject ? resourceTypeObject->getRecycledVersion() : nullptr;
|
||||
if (recycledTypeObject)
|
||||
return (recycledTypeObject->getNetworkId()).getValue();
|
||||
else
|
||||
|
||||
@@ -121,7 +121,7 @@ jint JNICALL ScriptMethodsScriptNamespace::attachScript(JNIEnv *env, jobject sel
|
||||
return SCRIPT_OVERRIDE;
|
||||
|
||||
GameScriptObject* scripts = object->getScriptObject();
|
||||
if (scripts == NULL)
|
||||
if (scripts == nullptr)
|
||||
return SCRIPT_OVERRIDE;
|
||||
|
||||
char buffer[MAX_SCRIPT_NAME_LEN];
|
||||
@@ -162,7 +162,7 @@ jboolean JNICALL ScriptMethodsScriptNamespace::detachScript(JNIEnv *env, jobject
|
||||
return JNI_FALSE;
|
||||
|
||||
GameScriptObject* scripts = object->getScriptObject();
|
||||
if (scripts == NULL)
|
||||
if (scripts == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
char buffer[MAX_SCRIPT_NAME_LEN];
|
||||
@@ -192,7 +192,7 @@ jboolean JNICALL ScriptMethodsScriptNamespace::detachAllScripts(JNIEnv *env, job
|
||||
return JNI_FALSE;
|
||||
|
||||
GameScriptObject* scriptObject = object->getScriptObject();
|
||||
if (scriptObject == NULL)
|
||||
if (scriptObject == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
std::vector<std::string> scriptNames;
|
||||
@@ -230,7 +230,7 @@ jboolean JNICALL ScriptMethodsScriptNamespace::hasScript(JNIEnv *env, jobject se
|
||||
return JNI_FALSE;
|
||||
|
||||
GameScriptObject* scripts = object->getScriptObject();
|
||||
if (scripts == NULL)
|
||||
if (scripts == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
char buffer[MAX_SCRIPT_NAME_LEN];
|
||||
@@ -325,7 +325,7 @@ jboolean JNICALL ScriptMethodsScriptNamespace::localMessageTo(JNIEnv *env, jobje
|
||||
else
|
||||
{
|
||||
GameScriptObject* scripts = object->getScriptObject();
|
||||
if (scripts == NULL)
|
||||
if (scripts == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
ScriptDictionaryPtr dictionary(new JavaDictionary(params));
|
||||
@@ -400,7 +400,7 @@ jboolean JNICALL ScriptMethodsScriptNamespace::remoteMessageTo(JNIEnv *env, jobj
|
||||
* "messageTo" for players on the current planet
|
||||
*
|
||||
* If you want everyone on the planet to receive the message,
|
||||
* specify null for loc and -1.0f for radius; otherwise, specify
|
||||
* specify nullptr for loc and -1.0f for radius; otherwise, specify
|
||||
* a loc and a radius and only players on the planet within the
|
||||
* specified area will receive the message
|
||||
*/
|
||||
@@ -447,7 +447,7 @@ jint JNICALL ScriptMethodsScriptNamespace::remoteMessageToCalendarTimeDayOfWeek(
|
||||
return -1;
|
||||
|
||||
// calculate the absolute time when the messageTo should go off
|
||||
time_t const timeNow = ::time(NULL);
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
time_t const timeTarget = CalendarTime::getNextGMTTimeOcurrence(timeNow, dayOfWeek, hour, minute, second);
|
||||
|
||||
if ((timeTarget <= 0) || (timeTarget <= timeNow))
|
||||
@@ -487,7 +487,7 @@ jint JNICALL ScriptMethodsScriptNamespace::remoteMessageToCalendarTimeDayOfMonth
|
||||
return -1;
|
||||
|
||||
// calculate the absolute time when the messageTo should go off
|
||||
time_t const timeNow = ::time(NULL);
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
time_t const timeTarget = CalendarTime::getNextGMTTimeOcurrence(timeNow, month, dayOfMonth, hour, minute, second);
|
||||
|
||||
if ((timeTarget <= 0) || (timeTarget <= timeNow))
|
||||
@@ -562,7 +562,7 @@ void JNICALL ScriptMethodsScriptNamespace::cancelRecurringMessageTo(JNIEnv *env,
|
||||
// returns -1 if object doesn't have the messageTo
|
||||
jint JNICALL ScriptMethodsScriptNamespace::timeUntilMessageTo(JNIEnv *env, jobject self, jlong object, jstring methodName)
|
||||
{
|
||||
ServerObject const * so = NULL;
|
||||
ServerObject const * so = nullptr;
|
||||
if (!JavaLibrary::getObject(object, so))
|
||||
return -1;
|
||||
|
||||
@@ -606,7 +606,7 @@ jint JNICALL ScriptMethodsScriptNamespace::getCalendarTimeSeconds(JNIEnv * env,
|
||||
if(env == 0)
|
||||
return 0;
|
||||
|
||||
return ::time(NULL);
|
||||
return ::time(nullptr);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -616,7 +616,7 @@ jint JNICALL ScriptMethodsScriptNamespace::getCalendarTimeSeconds2(JNIEnv * env,
|
||||
if(env == 0)
|
||||
return -1;
|
||||
|
||||
time_t const rawtime = ::time(NULL);
|
||||
time_t const rawtime = ::time(nullptr);
|
||||
struct tm * timeinfo = ::localtime(&rawtime);
|
||||
if (!timeinfo)
|
||||
return -1;
|
||||
@@ -678,7 +678,7 @@ jint JNICALL ScriptMethodsScriptNamespace::secondsUntilCalendarTimeDayOfWeek(JNI
|
||||
UNREF(self);
|
||||
|
||||
// calculate the time between now and the specified time
|
||||
time_t const timeNow = ::time(NULL);
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
time_t const timeTarget = CalendarTime::getNextGMTTimeOcurrence(timeNow, dayOfWeek, hour, minute, second);
|
||||
|
||||
if ((timeTarget <= 0) || (timeTarget <= timeNow))
|
||||
@@ -694,7 +694,7 @@ jint JNICALL ScriptMethodsScriptNamespace::secondsUntilCalendarTimeDayOfMonth(JN
|
||||
UNREF(self);
|
||||
|
||||
// calculate the time between now and the specified time
|
||||
time_t const timeNow = ::time(NULL);
|
||||
time_t const timeNow = ::time(nullptr);
|
||||
time_t const timeTarget = CalendarTime::getNextGMTTimeOcurrence(timeNow, month, dayOfMonth, hour, minute, second);
|
||||
|
||||
if ((timeTarget <= 0) || (timeTarget <= timeNow))
|
||||
|
||||
@@ -83,14 +83,14 @@ jint JNICALL ScriptMethodsServerUINamespace::createSuiPage(JNIEnv *env, jobject
|
||||
JavaStringParam localPageName(pageName);
|
||||
|
||||
jint failureCode = -1;
|
||||
ServerObject* owner = NULL;
|
||||
ServerObject* owner = nullptr;
|
||||
if(!JavaLibrary::getObject(ownerobject, owner))
|
||||
{
|
||||
WARNING(true, ("SUI: couldn't get owner ServerObject*, can't create a page"));
|
||||
return failureCode;
|
||||
}
|
||||
|
||||
ServerObject* so = NULL;
|
||||
ServerObject* so = nullptr;
|
||||
if(!JavaLibrary::getObject(client, so))
|
||||
return failureCode;
|
||||
|
||||
@@ -296,7 +296,7 @@ jboolean JNICALL ScriptMethodsServerUINamespace::subscribeToSuiEvent(JNIEnv
|
||||
}
|
||||
|
||||
std::string ewn;
|
||||
if (eventWidgetName != NULL)
|
||||
if (eventWidgetName != nullptr)
|
||||
{
|
||||
JavaStringParam localEventWidgetName(eventWidgetName);
|
||||
JavaLibrary::convert(localEventWidgetName, ewn);
|
||||
@@ -323,7 +323,7 @@ jboolean JNICALL ScriptMethodsServerUINamespace::subscribeToSuiPropertyForEv
|
||||
}
|
||||
|
||||
std::string ewn;
|
||||
if (eventWidgetName != NULL)
|
||||
if (eventWidgetName != nullptr)
|
||||
{
|
||||
JavaStringParam localEventWidgetName(eventWidgetName);
|
||||
JavaLibrary::convert(localEventWidgetName, ewn);
|
||||
@@ -411,7 +411,7 @@ jboolean JNICALL ScriptMethodsServerUINamespace::setSuiAssociatedLocation(JN
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
ServerObject* associatedObject = NULL;
|
||||
ServerObject* associatedObject = nullptr;
|
||||
if(!JavaLibrary::getObject(j_associatedObjectId, associatedObject))
|
||||
{
|
||||
DEBUG_WARNING(true, ("could not find object for associatedObjectid"));
|
||||
@@ -441,12 +441,12 @@ jboolean JNICALL ScriptMethodsServerUINamespace::setSuiMaxRangeToObject(JNIE
|
||||
|
||||
jboolean JNICALL ScriptMethodsServerUINamespace::clientMinigameOpen(JNIEnv *env, jobject self, jlong player, jobject data)
|
||||
{
|
||||
ServerObject* playerServerObject = NULL;
|
||||
ServerObject* playerServerObject = nullptr;
|
||||
if(!JavaLibrary::getObject(player, playerServerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
CreatureObject * creatureObject = playerServerObject->asCreatureObject();
|
||||
if(creatureObject != NULL)
|
||||
if(creatureObject != nullptr)
|
||||
{
|
||||
ValueDictionary gameData;
|
||||
JavaLibrary::convert(data, gameData);
|
||||
@@ -462,12 +462,12 @@ jboolean JNICALL ScriptMethodsServerUINamespace::clientMinigameOpen(JNIEnv *env,
|
||||
|
||||
jboolean JNICALL ScriptMethodsServerUINamespace::clientMinigameClose(JNIEnv *env, jobject self, jlong player, jobject data)
|
||||
{
|
||||
ServerObject* playerServerObject = NULL;
|
||||
ServerObject* playerServerObject = nullptr;
|
||||
if(!JavaLibrary::getObject(player, playerServerObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
CreatureObject * creatureObject = playerServerObject->asCreatureObject();
|
||||
if(creatureObject != NULL)
|
||||
if(creatureObject != nullptr)
|
||||
{
|
||||
ValueDictionary gameData;
|
||||
JavaLibrary::convert(data, gameData);
|
||||
|
||||
@@ -83,13 +83,13 @@ namespace ScriptMethodsShipNamespace
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
char buf[256];
|
||||
snprintf(buf, sizeof(buf), "JavaLibrary::%s: ship obj_id did not resolve to a ShipObject", functionName);
|
||||
ShipObject * const shipObject = JavaLibrary::getShipThrow(env, jobject_shipId, buf, throwIfNotOnServer);
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (chassisSlot != ShipChassisSlotType::SCST_num_types && !shipObject->isSlotInstalled(chassisSlot))
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::%s chassisSlot [%d] not installed", functionName, chassisSlot));
|
||||
@@ -1115,17 +1115,17 @@ jstring JNICALL ScriptMethodsShipNamespace::getShipChassisType(JNIEnv * env, job
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipObject const * const shipObject = JavaLibrary::getShipThrow(env, jobject_shipId, "getShipChassisType(): shipId obj_id did not resolve to a ShipObject", false);
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipChassis const * const shipChassis = ShipChassis::findShipChassisByCrc (shipObject->getChassisType());
|
||||
if (shipChassis)
|
||||
return JavaString(shipChassis->getName ().getString ()).getReturnValue();
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -1339,7 +1339,7 @@ jstring JNICALL ScriptMethodsShipNamespace::getShipComponentName(JNIEnv * env, j
|
||||
{
|
||||
ShipObject const * const shipObject = JavaLibrary::getShipThrow(env, jobject_shipId, "getShipComponentName() invalid ship", false);
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Unicode::String const & name = shipObject->getComponentName(chassisSlot);
|
||||
if (!name.empty())
|
||||
@@ -1918,9 +1918,9 @@ void JNICALL ScriptMethodsShipNamespace::setShipComponentName(JNIEnv * env, jobj
|
||||
if (!shipObject)
|
||||
return;
|
||||
|
||||
if (componentName == NULL)
|
||||
if (componentName == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::setShipComponentName (): null name"));
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::setShipComponentName (): nullptr name"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2442,7 +2442,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::shipCanInstallComponent(JNIEnv * en
|
||||
return false;
|
||||
|
||||
TangibleObject * tangibleComponent = 0;
|
||||
if (JavaLibrary::getObject (component, tangibleComponent) && tangibleComponent != NULL)
|
||||
if (JavaLibrary::getObject (component, tangibleComponent) && tangibleComponent != nullptr)
|
||||
return shipObject->canInstallComponent(chassisSlot, *tangibleComponent);
|
||||
else
|
||||
{
|
||||
@@ -2481,7 +2481,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::shipInstallComponent(JNIEnv * env,
|
||||
NetworkId installerId(jobject_installerId);
|
||||
|
||||
TangibleObject * tangibleComponent = 0;
|
||||
if (JavaLibrary::getObject (component, tangibleComponent) && tangibleComponent != NULL)
|
||||
if (JavaLibrary::getObject (component, tangibleComponent) && tangibleComponent != nullptr)
|
||||
return shipObject->installComponent(installerId, chassisSlot, *tangibleComponent);
|
||||
else
|
||||
{
|
||||
@@ -2546,11 +2546,11 @@ jintArray JNICALL ScriptMethodsShipNamespace::getShipChassisSlots(JNIEnv * env,
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipObject const * const shipObject = JavaLibrary::getShipThrow(env, jobject_shipId, "getShipChassisSlots(): shipId obj_id did not resolve to a ShipObject", false);
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipChassis const * const shipChassis = ShipChassis::findShipChassisByCrc (shipObject->getChassisType());
|
||||
if (shipChassis)
|
||||
@@ -2571,7 +2571,7 @@ jintArray JNICALL ScriptMethodsShipNamespace::getShipChassisSlots(JNIEnv * env,
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -2585,7 +2585,7 @@ jint JNICALL ScriptMethodsShipNamespace::getShipComponentDescriptorType(JNIEnv *
|
||||
TangibleObject * tangibleComponent = 0;
|
||||
if (JavaLibrary::getObject (jobject_component, tangibleComponent))
|
||||
{
|
||||
if (tangibleComponent != NULL && tangibleComponent->getObjectTemplate () != NULL)
|
||||
if (tangibleComponent != nullptr && tangibleComponent->getObjectTemplate () != nullptr)
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor =
|
||||
ShipComponentDescriptor::findShipComponentDescriptorByObjectTemplate (tangibleComponent->getObjectTemplate ()->getCrcName ().getCrc ());
|
||||
@@ -2623,7 +2623,7 @@ jstring JNICALL ScriptMethodsShipNamespace::getShipComponentDescriptorTypeNam
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::string const & typeName = ShipComponentType::getNameFromType(static_cast<ShipComponentType::Type>(componentType));
|
||||
|
||||
@@ -2641,7 +2641,7 @@ jint JNICALL ScriptMethodsShipNamespace::getShipComponentDescriptorCrc(JNI
|
||||
TangibleObject * tangibleComponent = 0;
|
||||
if (JavaLibrary::getObject (jobject_component, tangibleComponent))
|
||||
{
|
||||
if (tangibleComponent != NULL && tangibleComponent->getObjectTemplate () != NULL)
|
||||
if (tangibleComponent != nullptr && tangibleComponent->getObjectTemplate () != nullptr)
|
||||
{
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor =
|
||||
ShipComponentDescriptor::findShipComponentDescriptorByObjectTemplate (tangibleComponent->getObjectTemplate ()->getCrcName ().getCrc ());
|
||||
@@ -2659,11 +2659,11 @@ jstring JNICALL ScriptMethodsShipNamespace::getShipComponentDescriptorCrcName
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = ShipComponentDescriptor::findShipComponentDescriptorByCrc(static_cast<uint32>(componentCrc));
|
||||
if (shipComponentDescriptor == NULL)
|
||||
return NULL;
|
||||
if (shipComponentDescriptor == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return JavaString(shipComponentDescriptor->getName().getString()).getReturnValue();
|
||||
}
|
||||
@@ -2674,11 +2674,11 @@ jstring JNICALL ScriptMethodsShipNamespace::getShipComponentDescriptorCompati
|
||||
{
|
||||
//-- Make sure ships are enabled
|
||||
if (!verifyShipsEnabled())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipComponentDescriptor const * const shipComponentDescriptor = ShipComponentDescriptor::findShipComponentDescriptorByCrc(static_cast<uint32>(componentCrc));
|
||||
if (shipComponentDescriptor == NULL)
|
||||
return NULL;
|
||||
if (shipComponentDescriptor == nullptr)
|
||||
return nullptr;
|
||||
|
||||
return JavaString(shipComponentDescriptor->getCompatibility().getString()).getReturnValue();
|
||||
}
|
||||
@@ -2776,15 +2776,15 @@ void JNICALL ScriptMethodsShipNamespace::notifyShipDamage(JNIEnv * env, jobject
|
||||
if (victimShipObject->isPlayerShip())
|
||||
{
|
||||
//-- Get the attacker object. It can be any tangible object.
|
||||
TangibleObject const * attackerTangibleObject = NULL;
|
||||
TangibleObject const * attackerTangibleObject = nullptr;
|
||||
if (jobject_attacker)
|
||||
IGNORE_RETURN(JavaLibrary::getObject(jobject_attacker, attackerTangibleObject));
|
||||
|
||||
Controller * const victimShipController = victimShipObject->getController();
|
||||
if (victimShipController)
|
||||
{
|
||||
ShipDamageMessage shipDamage(attackerTangibleObject != NULL ? attackerTangibleObject->getNetworkId() : NetworkId::cms_invalid,
|
||||
attackerTangibleObject != NULL ? attackerTangibleObject->getPosition_w() : victimShipObject->getPosition_w(),
|
||||
ShipDamageMessage shipDamage(attackerTangibleObject != nullptr ? attackerTangibleObject->getNetworkId() : NetworkId::cms_invalid,
|
||||
attackerTangibleObject != nullptr ? attackerTangibleObject->getPosition_w() : victimShipObject->getPosition_w(),
|
||||
totalDamage );
|
||||
|
||||
//lint -esym(429, damageMessage)
|
||||
@@ -3008,7 +3008,7 @@ jlong JNICALL ScriptMethodsShipNamespace::getDroidControlDeviceForShip(JNIEnv *
|
||||
|
||||
NetworkId const & droidControlDeviceId = shipObject->getInstalledDroidControlDevice();
|
||||
Object const * const droidControlDevice = NetworkIdManager::getObjectById(droidControlDeviceId);
|
||||
ServerObject const * const serverDroidControlDevice = droidControlDevice ? droidControlDevice->asServerObject() : NULL;
|
||||
ServerObject const * const serverDroidControlDevice = droidControlDevice ? droidControlDevice->asServerObject() : nullptr;
|
||||
if(!serverDroidControlDevice)
|
||||
return 0;
|
||||
else
|
||||
@@ -3050,7 +3050,7 @@ void JNICALL ScriptMethodsShipNamespace::commPlayers(JNIEnv *env, jobject /*self
|
||||
|
||||
uint32 appearanceOverloadSharedTemplateCrc = 0;
|
||||
ObjectTemplate const * const ot = ObjectTemplateList::fetch(Unicode::wideToNarrow(appearanceOverloadServerTemplateWide));
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : NULL;
|
||||
ServerObjectTemplate const * const sot = ot ? ot->asServerObjectTemplate() : nullptr;
|
||||
if(sot)
|
||||
{
|
||||
std::string const & sharedTemplateName = sot->getSharedTemplate();
|
||||
@@ -3197,7 +3197,7 @@ jlong JNICALL ScriptMethodsShipNamespace::launchShipFromHangar(JNIEnv *env, jobj
|
||||
Transform const & finalCreateTransform = launchingShip->getTransform_o2p().rotateTranslate_l2p(finalHangarDelta_o);
|
||||
|
||||
ServerObject * const newShip = ServerWorld::createNewObject(crcName.getCrc(), finalCreateTransform, cell, false);
|
||||
if (newShip == NULL)
|
||||
if (newShip == nullptr)
|
||||
return 0;
|
||||
|
||||
// create an objId to return
|
||||
@@ -3223,7 +3223,7 @@ void JNICALL ScriptMethodsShipNamespace::handleShipDestruction(JNIEnv * en
|
||||
|
||||
//convert ship
|
||||
ShipObject * const ship = JavaLibrary::getShipThrow(env, jship, "handleShipDestruction(): shipId obj_id did not resolve to a ShipObject", false);
|
||||
if (ship == NULL)
|
||||
if (ship == nullptr)
|
||||
return;
|
||||
|
||||
DestroyShipMessage const msg(ship->getNetworkId(), severity);
|
||||
@@ -3401,7 +3401,7 @@ jfloat JNICALL ScriptMethodsShipNamespace::getShipInternalDamageOverTimeDamageRa
|
||||
return 0.0f;
|
||||
|
||||
static ShipInternalDamageOverTime const * const idot = ShipInternalDamageOverTimeManager::findEntry(*ship, chassisSlot);
|
||||
if (idot == NULL)
|
||||
if (idot == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipInternalDamageOverTimeDamageThreshold idot for [%s] slot [%d] not found", ship->getNetworkId().getValueString().c_str(), chassisSlot));
|
||||
return 0.0f;
|
||||
@@ -3419,7 +3419,7 @@ jfloat JNICALL ScriptMethodsShipNamespace::getShipInternalDamageOverTimeDamageTh
|
||||
return 0.0f;
|
||||
|
||||
static ShipInternalDamageOverTime const * const idot = ShipInternalDamageOverTimeManager::findEntry(*ship, chassisSlot);
|
||||
if (idot == NULL)
|
||||
if (idot == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipInternalDamageOverTimeDamageThreshold idot for [%s] slot [%d] not found", ship->getNetworkId().getValueString().c_str(), chassisSlot));
|
||||
return 0.0f;
|
||||
@@ -3437,11 +3437,11 @@ jboolean JNICALL ScriptMethodsShipNamespace::hasShipInternalDamageOverTime(JNIEn
|
||||
|
||||
//convert ship
|
||||
ShipObject * const ship = JavaLibrary::getShipThrow(env, jship, "hasShipInternalDamageOverTime(): shipId obj_id did not resolve to a ShipObject", false);
|
||||
if (ship == NULL)
|
||||
if (ship == nullptr)
|
||||
return false;
|
||||
|
||||
static ShipInternalDamageOverTime const * const idot = ShipInternalDamageOverTimeManager::findEntry(*ship, chassisSlot);
|
||||
return idot != NULL;
|
||||
return idot != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -3576,7 +3576,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::shipIsInNebula(JNIEnv *env, jobject
|
||||
|
||||
std::string nebulaName;
|
||||
|
||||
if (NULL != j_nebulaName)
|
||||
if (nullptr != j_nebulaName)
|
||||
{
|
||||
JavaStringParam const jsp(j_nebulaName);
|
||||
if (!JavaLibrary::convert(jsp, nebulaName))
|
||||
@@ -3593,7 +3593,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::shipIsInNebula(JNIEnv *env, jobject
|
||||
{
|
||||
int const id = *it;
|
||||
Nebula const * const nebula = NebulaManager::getNebulaById(id);
|
||||
if (NULL != nebula)
|
||||
if (nullptr != nebula)
|
||||
{
|
||||
if (nebula->getName() == nebulaName)
|
||||
return JNI_TRUE;
|
||||
@@ -3637,7 +3637,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::setShipWingName(JNIEnv * /*env*/, j
|
||||
|
||||
jstring JNICALL ScriptMethodsShipNamespace::getShipWingName(JNIEnv * /*env*/, jobject /*self*/, jlong target)
|
||||
{
|
||||
ServerObject const * object = NULL;
|
||||
ServerObject const * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipWingName (): could not convert the target"));
|
||||
@@ -3686,7 +3686,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::setShipTypeName(JNIEnv * /*env*/, j
|
||||
|
||||
jstring JNICALL ScriptMethodsShipNamespace::getShipTypeName(JNIEnv * /*env*/, jobject /*self*/, jlong target)
|
||||
{
|
||||
ServerObject const * object = NULL;
|
||||
ServerObject const * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipTypeName (): could not convert the target"));
|
||||
@@ -3735,7 +3735,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::setShipDifficulty(JNIEnv * /*env*/,
|
||||
|
||||
jstring JNICALL ScriptMethodsShipNamespace::getShipDifficulty(JNIEnv * /*env*/, jobject /*self*/, jlong target)
|
||||
{
|
||||
ServerObject const * object = NULL;
|
||||
ServerObject const * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipDifficulty (): could not convert the target"));
|
||||
@@ -3783,7 +3783,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::setShipFaction(JNIEnv * /*env*/, jo
|
||||
|
||||
jstring JNICALL ScriptMethodsShipNamespace::getShipFaction(JNIEnv * /*env*/, jobject /*self*/, jlong target)
|
||||
{
|
||||
ServerObject const * object = NULL;
|
||||
ServerObject const * object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::getShipFaction (): could not convert the target"));
|
||||
@@ -3871,7 +3871,7 @@ jboolean JNICALL ScriptMethodsShipNamespace::isMissionCriticalObject(JNIEnv * en
|
||||
|
||||
if (!ship)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("isMissionCriticalObject(): playerId ship is null"));
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("isMissionCriticalObject(): playerId ship is nullptr"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -3973,7 +3973,7 @@ void JNICALL ScriptMethodsShipNamespace::setDynamicMiningAsteroidVelocity(JNIEnv
|
||||
}
|
||||
|
||||
MiningAsteroidController * const miningAsteroidController = dynamic_cast<MiningAsteroidController * >(shipObject->getController());
|
||||
if (NULL == miningAsteroidController)
|
||||
if (nullptr == miningAsteroidController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("setDynamicMiningAsteroidVelocity(): called on a ship which is not a dynamic mining asteroid"));
|
||||
return;
|
||||
@@ -3988,12 +3988,12 @@ jobject JNICALL ScriptMethodsShipNamespace::getDynamicMiningAsteroidVelocity(JNI
|
||||
{
|
||||
ShipObject * const shipObject = JavaLibrary::getShipThrow(env, jobject_asteroidId, "getDynamicMiningAsteroidVelocity(): shipId did not resolve to a ShipObject", false);
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
MiningAsteroidController * const miningAsteroidController = dynamic_cast<MiningAsteroidController * >(shipObject->getController());
|
||||
if (NULL == miningAsteroidController)
|
||||
if (nullptr == miningAsteroidController)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("setDynamicMiningAsteroidVelocity(): called on a ship which is not a dynamic mining asteroid"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Vector const & velocity_w = miningAsteroidController->getVelocity_w();
|
||||
@@ -4073,7 +4073,7 @@ jlongArray JNICALL ScriptMethodsShipNamespace::getShipCargoHoldContentsResourceT
|
||||
{
|
||||
ShipObject const * const shipObject = getShipThrowTestSlot(env, jobject_shipId, "getShipCargoHoldContents()", false, static_cast<int>(ShipChassisSlotType::SCST_cargo_hold));
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipObject::NetworkIdIntMap const & contents = shipObject->getCargoHoldContents();
|
||||
|
||||
@@ -4090,7 +4090,7 @@ jlongArray JNICALL ScriptMethodsShipNamespace::getShipCargoHoldContentsResourceT
|
||||
return jids->getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -4099,7 +4099,7 @@ jintArray JNICALL ScriptMethodsShipNamespace::getShipCargoHoldContentsAmounts(JN
|
||||
{
|
||||
ShipObject const * const shipObject = getShipThrowTestSlot(env, jobject_shipId, "getShipCargoHoldContents()", false, static_cast<int>(ShipChassisSlotType::SCST_cargo_hold));
|
||||
if (!shipObject)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ShipObject::NetworkIdIntMap const & contents = shipObject->getCargoHoldContents();
|
||||
|
||||
@@ -4115,7 +4115,7 @@ jintArray JNICALL ScriptMethodsShipNamespace::getShipCargoHoldContentsAmounts(JN
|
||||
return jamounts->getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -4125,9 +4125,9 @@ void JNICALL ScriptMethodsShipNamespace::openSpaceMiningUi(JNIEnv * env, jobject
|
||||
NetworkId const & playerId = NetworkId(jobject_player);
|
||||
NetworkId const & spaceStationId = NetworkId(jobject_spaceStation);
|
||||
|
||||
if (jstring_spaceStationName == NULL)
|
||||
if (jstring_spaceStationName == nullptr)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::setShipComponentName (): null name"));
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true, ("JavaLibrary::setShipComponentName (): nullptr name"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4140,7 +4140,7 @@ void JNICALL ScriptMethodsShipNamespace::openSpaceMiningUi(JNIEnv * env, jobject
|
||||
}
|
||||
|
||||
Object * const player = NetworkIdManager::getObjectById(playerId);
|
||||
Controller * const controller = player ? player->getController(): NULL;
|
||||
Controller * const controller = player ? player->getController(): nullptr;
|
||||
|
||||
if (!controller)
|
||||
{
|
||||
|
||||
@@ -276,7 +276,7 @@ jobjectArray JNICALL ScriptMethodsSkillNamespace::getSkillCommandsProvided(JNIEn
|
||||
|
||||
const SkillObject * skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
LocalObjectArrayRefPtr strArray;
|
||||
if(! ScriptConversion::convert(skill->getCommandsProvided(), strArray))
|
||||
@@ -293,7 +293,7 @@ jobject JNICALL ScriptMethodsSkillNamespace::getSkillPrerequisiteExperience(JNIE
|
||||
|
||||
const SkillObject * skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
JavaDictionaryPtr dict;
|
||||
if (!JavaLibrary::convert(skill->getPrerequisiteExperienceVector(), dict))
|
||||
@@ -334,7 +334,7 @@ jobjectArray JNICALL ScriptMethodsSkillNamespace::getSkillPrerequisiteSkills(JNI
|
||||
|
||||
const SkillObject * skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
std::vector<std::string> skillNames;
|
||||
std::vector<const SkillObject *>::const_iterator i;
|
||||
@@ -358,7 +358,7 @@ jobject JNICALL ScriptMethodsSkillNamespace::getSkillPrerequisiteSpecies(JNIEnv
|
||||
|
||||
const SkillObject * skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
JavaDictionaryPtr dict;
|
||||
if (!JavaLibrary::convert(skill->getPrerequisiteSpecies(), dict))
|
||||
@@ -374,14 +374,14 @@ jstring JNICALL ScriptMethodsSkillNamespace::getSkillProfession(JNIEnv *env, job
|
||||
|
||||
const SkillObject * const skill = getSkill(localSkillName);
|
||||
if(!skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
const SkillObject * const prof = skill->findProfessionForSkill ();
|
||||
if(prof)
|
||||
{
|
||||
JavaString str(prof->getSkillName().c_str());
|
||||
return str.getReturnValue();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -423,7 +423,7 @@ jobject JNICALL ScriptMethodsSkillNamespace::getSkillStatisticModifiers(JNIEnv *
|
||||
|
||||
const SkillObject * skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
JavaDictionaryPtr dict;
|
||||
if (!JavaLibrary::convert(skill->getStatisticModifiers(), dict))
|
||||
@@ -450,7 +450,7 @@ jint JNICALL ScriptMethodsSkillNamespace::getCreatureSkillStatisticModifier(JNIE
|
||||
|
||||
JavaStringParam jskillStatName(skillStatName);
|
||||
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, object))
|
||||
return 0;
|
||||
|
||||
@@ -472,7 +472,7 @@ jint JNICALL ScriptMethodsSkillNamespace::getCreatureSkillStatisticModifier(JNIE
|
||||
* @param creature the creature whose stat mod we want
|
||||
* @param skillStatNames array of names of the skill stat mods we want
|
||||
*
|
||||
* @return the skill stat mod values, or null on error
|
||||
* @return the skill stat mod values, or nullptr on error
|
||||
*/
|
||||
jintArray JNICALL ScriptMethodsSkillNamespace::getCreatureSkillStatisticModifiers(JNIEnv *env, jobject self, jlong creature, jobjectArray skillStatNames)
|
||||
{
|
||||
@@ -481,7 +481,7 @@ jintArray JNICALL ScriptMethodsSkillNamespace::getCreatureSkillStatisticModifier
|
||||
if (skillStatNames == 0)
|
||||
return 0;
|
||||
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, object))
|
||||
return 0;
|
||||
|
||||
@@ -555,7 +555,7 @@ jint JNICALL ScriptMethodsSkillNamespace::internalGetCreatureEnhancedSkillStatis
|
||||
|
||||
JavaStringParam jskillStatName(skillStatName);
|
||||
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, object))
|
||||
return 0;
|
||||
|
||||
@@ -577,7 +577,7 @@ jint JNICALL ScriptMethodsSkillNamespace::internalGetCreatureEnhancedSkillStatis
|
||||
* @param creature the creature whose stat mod we want
|
||||
* @param skillStatNames array of names of the skill stat mods we want
|
||||
*
|
||||
* @return the skill stat mod values, or null on error
|
||||
* @return the skill stat mod values, or nullptr on error
|
||||
*/
|
||||
jintArray JNICALL ScriptMethodsSkillNamespace::internalGetCreatureEnhancedSkillStatisticModifiers(JNIEnv *env, jobject self, jlong creature, jobjectArray skillStatNames, jboolean useBonusCap)
|
||||
{
|
||||
@@ -586,7 +586,7 @@ jintArray JNICALL ScriptMethodsSkillNamespace::internalGetCreatureEnhancedSkillS
|
||||
if (skillStatNames == 0)
|
||||
return 0;
|
||||
|
||||
const CreatureObject * object = NULL;
|
||||
const CreatureObject * object = nullptr;
|
||||
if (!JavaLibrary::getObject(creature, object))
|
||||
return 0;
|
||||
|
||||
@@ -621,7 +621,7 @@ jstring JNICALL ScriptMethodsSkillNamespace::getSkillTitleGranted(JNIEnv *env, j
|
||||
|
||||
const SkillObject * const skill = getSkill(localSkillName);
|
||||
if(! skill)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
if (skill->isTitle ())
|
||||
return JavaString(skill->getSkillName ().c_str()).getReturnValue();
|
||||
@@ -665,7 +665,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByString(JNIEnv *
|
||||
if(name.empty())
|
||||
{
|
||||
// throw java exception
|
||||
JavaLibrary::throwInternalScriptError("JavaLibrary::grantExperiencePoints() was passed an EMPTY or NULL experience name. This is probably not what the script intends to do, and the database cannot save unnamed XP. Change your script to ensure that it is calling grantExperiencePoints with the intended parameters.");
|
||||
JavaLibrary::throwInternalScriptError("JavaLibrary::grantExperiencePoints() was passed an EMPTY or nullptr experience name. This is probably not what the script intends to do, and the database cannot save unnamed XP. Change your script to ensure that it is calling grantExperiencePoints with the intended parameters.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -675,7 +675,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByString(JNIEnv *
|
||||
WARNING(true, ("JavaLibrary::grantExperiencePointsByString called "
|
||||
"with target id = 0"));
|
||||
}
|
||||
else if (targetId.getObject() == NULL)
|
||||
else if (targetId.getObject() == nullptr)
|
||||
{
|
||||
if (NameManager::getInstance().getPlayerName(targetId).empty())
|
||||
{
|
||||
@@ -683,7 +683,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByString(JNIEnv *
|
||||
"with target id = %s, who is not in the player name map",
|
||||
targetId.getValueString().c_str()));
|
||||
}
|
||||
// else if (ServerUniverse::getInstance().getXpManager() != NULL)
|
||||
// else if (ServerUniverse::getInstance().getXpManager() != nullptr)
|
||||
// {
|
||||
// ServerUniverse::getInstance().getXpManager()->grantXp(targetId,
|
||||
// name, amount);
|
||||
@@ -701,7 +701,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByString(JNIEnv *
|
||||
else
|
||||
{
|
||||
CreatureObject * creature = dynamic_cast<CreatureObject *>(targetId.getObject());
|
||||
if (creature != NULL)
|
||||
if (creature != nullptr)
|
||||
{
|
||||
result = creature->grantExperiencePoints(name, static_cast<int>(amount));
|
||||
}
|
||||
@@ -741,7 +741,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByInt(JNIEnv *env
|
||||
|
||||
jint result = INT_MIN;
|
||||
CachedNetworkId targetId(target);
|
||||
if (targetId.getObject() == NULL)
|
||||
if (targetId.getObject() == nullptr)
|
||||
{
|
||||
if (targetId == CachedNetworkId::cms_cachedInvalid)
|
||||
{
|
||||
@@ -754,7 +754,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByInt(JNIEnv *env
|
||||
"with target id = %s, who is not in the player name map",
|
||||
targetId.getValueString().c_str()));
|
||||
}
|
||||
// else if (ServerUniverse::getInstance().getXpManager() != NULL)
|
||||
// else if (ServerUniverse::getInstance().getXpManager() != nullptr)
|
||||
// {
|
||||
// ServerUniverse::getInstance().getXpManager()->grantXp(targetId,
|
||||
// experienceTypeString, amount);
|
||||
@@ -772,7 +772,7 @@ jint JNICALL ScriptMethodsSkillNamespace::grantExperiencePointsByInt(JNIEnv *env
|
||||
else
|
||||
{
|
||||
CreatureObject * creature = dynamic_cast<CreatureObject *>(targetId.getObject());
|
||||
if (creature != NULL)
|
||||
if (creature != nullptr)
|
||||
{
|
||||
result = creature->grantExperiencePoints(experienceTypeString, static_cast<int>(amount));
|
||||
}
|
||||
@@ -977,7 +977,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::grantSchematicGroup(JNIEnv *env, j
|
||||
|
||||
JavaStringParam groupNameParam(groupName);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1010,7 +1010,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::revokeSchematicGroup(JNIEnv *env,
|
||||
|
||||
JavaStringParam groupNameParam(groupName);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1067,7 +1067,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::grantSchematicCrc(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1120,7 +1120,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::revokeSchematicCrc(JNIEnv *env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1173,7 +1173,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::hasSchematicCrc(JNIEnv *env, jobje
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1191,11 +1191,11 @@ jboolean JNICALL ScriptMethodsSkillNamespace::hasSchematicCrc(JNIEnv *env, jobje
|
||||
* @param self class calling this function
|
||||
* @param player the player
|
||||
*
|
||||
* @return the skill mod names the player has, or null on error
|
||||
* @return the skill mod names the player has, or nullptr on error
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsSkillNamespace::getSkillStatModListingForPlayer(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creature))
|
||||
return 0;
|
||||
|
||||
@@ -1221,11 +1221,11 @@ jobjectArray JNICALL ScriptMethodsSkillNamespace::getSkillStatModListingForPlaye
|
||||
* @param self class calling this function
|
||||
* @param player the player
|
||||
*
|
||||
* @return the commands the player has, or null on error
|
||||
* @return the commands the player has, or nullptr on error
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsSkillNamespace::getCommandListingForPlayer(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creature))
|
||||
return 0;
|
||||
|
||||
@@ -1261,7 +1261,7 @@ jintArray JNICALL ScriptMethodsSkillNamespace::getSkillSchematicsGranted(JNIEnv
|
||||
return 0;
|
||||
|
||||
const SkillObject * skill = SkillManager::getInstance().getSkill(name);
|
||||
if (skill == NULL)
|
||||
if (skill == nullptr)
|
||||
return 0;
|
||||
|
||||
// get all the granted schematics from the skill groups for the skill
|
||||
@@ -1304,11 +1304,11 @@ jintArray JNICALL ScriptMethodsSkillNamespace::getSkillSchematicsGranted(JNIEnv
|
||||
* @param self class calling this function
|
||||
* @param player the player
|
||||
*
|
||||
* @return the schematics' crc, or null on error
|
||||
* @return the schematics' crc, or nullptr on error
|
||||
*/
|
||||
jintArray JNICALL ScriptMethodsSkillNamespace::getSchematicListingForPlayer(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
const CreatureObject * creature = NULL;
|
||||
const CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creature))
|
||||
return 0;
|
||||
|
||||
@@ -1335,7 +1335,7 @@ jintArray JNICALL ScriptMethodsSkillNamespace::getSchematicListingForPlayer(JNIE
|
||||
|
||||
jboolean JNICALL ScriptMethodsSkillNamespace::hasCertificationsForItem(JNIEnv *env, jobject self, jlong player, jlong item)
|
||||
{
|
||||
const CreatureObject * creatureObject = NULL;
|
||||
const CreatureObject * creatureObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, creatureObject) || !creatureObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1349,7 +1349,7 @@ jboolean JNICALL ScriptMethodsSkillNamespace::hasCertificationsForItem(JNIEnv *e
|
||||
}
|
||||
}
|
||||
|
||||
const TangibleObject * itemObject = NULL;
|
||||
const TangibleObject * itemObject = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObject) || !itemObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1360,11 +1360,11 @@ jboolean JNICALL ScriptMethodsSkillNamespace::hasCertificationsForItem(JNIEnv *e
|
||||
|
||||
jobjectArray JNICALL ScriptMethodsSkillNamespace::getRequiredCertifications(JNIEnv *env, jobject self, jlong item)
|
||||
{
|
||||
const TangibleObject * itemAsTangible = NULL;
|
||||
const TangibleObject * itemAsTangible = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemAsTangible) || !itemAsTangible)
|
||||
{
|
||||
JAVA_THROW_SCRIPT_EXCEPTION(true,("getRequiredCertifications called with an object that does not exist"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<std::string> certs;
|
||||
@@ -1372,7 +1372,7 @@ jobjectArray JNICALL ScriptMethodsSkillNamespace::getRequiredCertifications(JNIE
|
||||
|
||||
LocalObjectArrayRefPtr results;
|
||||
if (!ScriptConversion::convert(certs, results))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return results->getReturnValue();
|
||||
}
|
||||
@@ -1381,7 +1381,7 @@ jobjectArray JNICALL ScriptMethodsSkillNamespace::getRequiredCertifications(JNIE
|
||||
|
||||
jstring JNICALL ScriptMethodsSkillNamespace::getSkillTemplate(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject const * creature = NULL;
|
||||
CreatureObject const * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
@@ -1393,14 +1393,14 @@ jstring JNICALL ScriptMethodsSkillNamespace::getSkillTemplate(JNIEnv *env, jobje
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void JNICALL ScriptMethodsSkillNamespace::setSkillTemplate(JNIEnv *env, jobject self, jlong player, jstring skillTemplateName)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
@@ -1422,7 +1422,7 @@ void JNICALL ScriptMethodsSkillNamespace::setSkillTemplate(JNIEnv *env, jobject
|
||||
|
||||
jstring JNICALL ScriptMethodsSkillNamespace::getWorkingSkill(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject const * creature = NULL;
|
||||
CreatureObject const * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
@@ -1435,14 +1435,14 @@ jstring JNICALL ScriptMethodsSkillNamespace::getWorkingSkill(JNIEnv *env, jobjec
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void JNICALL ScriptMethodsSkillNamespace::setWorkingSkill(JNIEnv *env, jobject self, jlong player, jstring workingSkillName)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
@@ -1464,7 +1464,7 @@ void JNICALL ScriptMethodsSkillNamespace::setWorkingSkill(JNIEnv *env, jobject s
|
||||
|
||||
void JNICALL ScriptMethodsSkillNamespace::recomputeCommandSeries(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
@@ -1476,7 +1476,7 @@ void JNICALL ScriptMethodsSkillNamespace::recomputeCommandSeries(JNIEnv *env, jo
|
||||
|
||||
void JNICALL ScriptMethodsSkillNamespace::resetExpertises(JNIEnv *env, jobject self, jlong player)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
|
||||
if (JavaLibrary::getObject(player, creature))
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
* @param self class calling this function
|
||||
* @param id the stringId to find
|
||||
*
|
||||
* @return the string, or null on error
|
||||
* @return the string, or nullptr on error
|
||||
*/
|
||||
jstring JNICALL ScriptMethodsStringNamespace::getString(JNIEnv *env, jobject self, jobject id)
|
||||
{
|
||||
@@ -64,7 +64,7 @@ jstring JNICALL ScriptMethodsStringNamespace::getString(JNIEnv *env, jobject sel
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
WARNING(true, ("JavaLibrary::log getString is NULL."));
|
||||
WARNING(true, ("JavaLibrary::log getString is nullptr."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ jstring JNICALL ScriptMethodsStringNamespace::getString(JNIEnv *env, jobject sel
|
||||
* @param self class calling this function
|
||||
* @param ids array of stringIds to find
|
||||
*
|
||||
* @return an array of strings, or null on error
|
||||
* @return an array of strings, or nullptr on error
|
||||
*/
|
||||
jobjectArray JNICALL ScriptMethodsStringNamespace::getStrings(JNIEnv *env, jobject self, jobjectArray ids)
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ jboolean JNICALL ScriptMethodsSystemNamespace::sendConsoleCommand(JNIEnv * env,
|
||||
{
|
||||
JavaStringParam localCommand(command);
|
||||
|
||||
ServerObject* object = NULL;
|
||||
ServerObject* object = nullptr;
|
||||
if (!JavaLibrary::getObject(target, object))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -86,7 +86,7 @@ jboolean JNICALL ScriptMethodsSystemNamespace::sendConsoleCommand(JNIEnv * env,
|
||||
* @param section the config file section
|
||||
* @param key the config file key
|
||||
*
|
||||
* @return the key value, or null if the key doesn't exist
|
||||
* @return the key value, or nullptr if the key doesn't exist
|
||||
*/
|
||||
jstring JNICALL ScriptMethodsSystemNamespace::getConfigSetting(JNIEnv * env, jobject self,
|
||||
jstring section, jstring key)
|
||||
@@ -108,12 +108,12 @@ jstring JNICALL ScriptMethodsSystemNamespace::getConfigSetting(JNIEnv * env, job
|
||||
return 0;
|
||||
|
||||
const ConfigFile::Section * sec = ConfigFile::getSection(sectionName.c_str());
|
||||
if (sec == NULL)
|
||||
if (sec == nullptr)
|
||||
return 0;
|
||||
|
||||
const ConfigFile::Key * ky = sec->findKey(keyName.c_str());
|
||||
if (ky == NULL)
|
||||
return NULL;
|
||||
if (ky == nullptr)
|
||||
return nullptr;
|
||||
|
||||
JavaString jvalue(ky->getAsString(ky->getCount()-1, ""));
|
||||
return jvalue.getReturnValue();
|
||||
|
||||
@@ -165,16 +165,16 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocation(JNIEnv * /*env*/,
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::getGoodLocation");
|
||||
|
||||
//validate scripter's input
|
||||
if (searchRectLowerLeftLocation == NULL)
|
||||
if (searchRectLowerLeftLocation == nullptr)
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB lower left is NULL"));
|
||||
return NULL;
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB lower left is nullptr"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (searchRectUpperRightLocation == NULL)
|
||||
if (searchRectUpperRightLocation == nullptr)
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB upper right is NULL"));
|
||||
return NULL;
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB upper right is nullptr"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//pull the data from the java Location objects. sceneid and cell are not checked or used, but sent back in the good location, if one exists
|
||||
@@ -184,14 +184,14 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocation(JNIEnv * /*env*/,
|
||||
if (!ScriptConversion::convertWorld(searchRectLowerLeftLocation, srLLLocationVec, sceneId))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB could not convert lower left coordinates"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Vector srURLocationVec;
|
||||
if (!ScriptConversion::convertWorld(searchRectUpperRightLocation, srURLocationVec, sceneId))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): DB could not convert upper right coordinates"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// get the good location from ServerWorld
|
||||
@@ -199,7 +199,7 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocation(JNIEnv * /*env*/,
|
||||
if (successLoc3d.x == 0 && successLoc3d.y == 0 && successLoc3d.z == 0)
|
||||
{
|
||||
// no good location available
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//convert it back into scripter lingo (a "location"), using the default scene and cell ids
|
||||
@@ -207,7 +207,7 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocation(JNIEnv * /*env*/,
|
||||
if (!ScriptConversion::convert(successLoc3d, sceneId, NetworkId(), goodLocation))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocation (): PB could not convert result back to a location"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return goodLocation->getReturnValue();
|
||||
@@ -218,16 +218,16 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocationAvoidCollidables(J
|
||||
PROFILER_AUTO_BLOCK_DEFINE("JNI::getGoodLocationAvoidCollidables");
|
||||
|
||||
//validate scripter's input
|
||||
if (searchRectLowerLeftLocation == NULL)
|
||||
if (searchRectLowerLeftLocation == nullptr)
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB lower left is NULL"));
|
||||
return NULL;
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB lower left is nullptr"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (searchRectUpperRightLocation == NULL)
|
||||
if (searchRectUpperRightLocation == nullptr)
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB upper right is NULL"));
|
||||
return NULL;
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB upper right is nullptr"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//pull the data from the java Location objects. sceneid and cell are not checked or used, but sent back in the good location, if one exists
|
||||
@@ -237,14 +237,14 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocationAvoidCollidables(J
|
||||
if (!ScriptConversion::convertWorld(searchRectLowerLeftLocation, srLLLocationVec, sceneId))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB could not convert lower left coordinates"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Vector srURLocationVec;
|
||||
if (!ScriptConversion::convertWorld(searchRectUpperRightLocation, srURLocationVec, sceneId))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): DB could not convert upper right coordinates"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// get the good location from ServerWorld
|
||||
@@ -252,7 +252,7 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocationAvoidCollidables(J
|
||||
if (successLoc3d.x == 0 && successLoc3d.y == 0 && successLoc3d.z == 0)
|
||||
{
|
||||
// no good location available
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//convert it back into scripter lingo (a "location"), using the default scene and cell ids
|
||||
@@ -260,7 +260,7 @@ jobject JNICALL ScriptMethodsTerrainNamespace::getGoodLocationAvoidCollidables(J
|
||||
if (!ScriptConversion::convert(successLoc3d, sceneId, NetworkId(), goodLocation))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getGoodLocationAvoidCollidables (): PB could not convert result back to a location"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return goodLocation->getReturnValue();
|
||||
@@ -587,7 +587,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::setWeatherData (JNIEnv* env, job
|
||||
UNREF(self);
|
||||
|
||||
PlanetObject * planet = ServerUniverse::getInstance().getCurrentPlanet();
|
||||
if (planet != NULL)
|
||||
if (planet != nullptr)
|
||||
{
|
||||
planet->setWeather(index, windVelocityX, 0.f, windVelocityZ);
|
||||
return JNI_TRUE;
|
||||
@@ -603,9 +603,9 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::setWeatherData (JNIEnv* env, job
|
||||
|
||||
jboolean JNICALL ScriptMethodsTerrainNamespace::isBelowWater (JNIEnv* /*env*/, jobject /*self*/, jobject location)
|
||||
{
|
||||
if (location == NULL)
|
||||
if (location == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] isBelowWater script hook was passed a NULL location reference"));
|
||||
DEBUG_WARNING(true, ("[designer bug] isBelowWater script hook was passed a nullptr location reference"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
@@ -621,7 +621,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::isBelowWater (JNIEnv* /*env*/, j
|
||||
const CellProperty* worldCell = CellProperty::getWorldCellProperty();
|
||||
if(!worldCell)
|
||||
{
|
||||
DEBUG_WARNING(true, ("isBelowWater got a NULL worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
DEBUG_WARNING(true, ("isBelowWater got a nullptr worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
return JNI_FALSE;
|
||||
}
|
||||
const NetworkId& worldCellId = worldCell->getOwner().getNetworkId();
|
||||
@@ -758,9 +758,9 @@ jfloat JNICALL ScriptMethodsTerrainNamespace::getWaterTableHeight (JNIEnv* /*env
|
||||
{
|
||||
float zero = 0.0f;
|
||||
|
||||
if (location == NULL)
|
||||
if (location == nullptr)
|
||||
{
|
||||
DEBUG_WARNING(true, ("[designer bug] getWaterTableHeight script hook was passed a NULL location reference"));
|
||||
DEBUG_WARNING(true, ("[designer bug] getWaterTableHeight script hook was passed a nullptr location reference"));
|
||||
return zero;
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@ jfloat JNICALL ScriptMethodsTerrainNamespace::getWaterTableHeight (JNIEnv* /*env
|
||||
const CellProperty* worldCell = CellProperty::getWorldCellProperty();
|
||||
if(!worldCell)
|
||||
{
|
||||
DEBUG_WARNING(true, ("getWaterTableHeight got a NULL worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
DEBUG_WARNING(true, ("getWaterTableHeight got a nullptr worldCell back from CellProperty::getWorldCellProperty()"));
|
||||
return zero;
|
||||
}
|
||||
const NetworkId& worldCellId = worldCell->getOwner().getNetworkId();
|
||||
@@ -862,7 +862,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::requestLocation (JNIEnv * /*env*
|
||||
jboolean JNICALL ScriptMethodsTerrainNamespace::isOnAFloor (JNIEnv * env, jobject self, jlong scriptObject)
|
||||
{
|
||||
//-- make sure we have a valid object
|
||||
ServerObject * theObject = NULL;
|
||||
ServerObject * theObject = nullptr;
|
||||
if (!JavaLibrary::getObject (scriptObject, theObject))
|
||||
{
|
||||
DEBUG_WARNING (true, ("isOnAFloor (): could not find scriptObject"));
|
||||
@@ -876,7 +876,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::isOnAFloor (JNIEnv * env, jobjec
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if(objectCollisionProp->getStandingOn() != NULL)
|
||||
if(objectCollisionProp->getStandingOn() != nullptr)
|
||||
return JNI_TRUE;
|
||||
else
|
||||
return JNI_FALSE;
|
||||
@@ -890,7 +890,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::isRelativePointOnSameFloorAsObje
|
||||
return JNI_FALSE;
|
||||
|
||||
//-- make sure we have a valid object
|
||||
ServerObject * theObject = NULL;
|
||||
ServerObject * theObject = nullptr;
|
||||
if (!JavaLibrary::getObject (scriptObject, theObject))
|
||||
{
|
||||
DEBUG_WARNING (true, ("isRelativePointOnSameFloorAsObject (): could not find scriptObject"));
|
||||
@@ -938,7 +938,7 @@ jfloat JNICALL ScriptMethodsTerrainNamespace::getFloorHeightAtRelativePointOnS
|
||||
return JNI_FALSE;
|
||||
|
||||
//-- make sure we have a valid object
|
||||
ServerObject * theObject = NULL;
|
||||
ServerObject * theObject = nullptr;
|
||||
if (!JavaLibrary::getObject (scriptObject, theObject))
|
||||
{
|
||||
DEBUG_WARNING (true, ("getFloorHeightAtRelativePointOnSameFloorAsObject (): could not find scriptObject"));
|
||||
@@ -1106,7 +1106,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::createClientPathAdvanced(JNIEnv
|
||||
*/
|
||||
jboolean JNICALL ScriptMethodsTerrainNamespace::setCreatureCoverDefault(JNIEnv *env, jobject self, jlong target)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1137,7 +1137,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::setCreatureCover(JNIEnv *env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if (!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1149,7 +1149,7 @@ jboolean JNICALL ScriptMethodsTerrainNamespace::setCreatureCover(JNIEnv *env, jo
|
||||
|
||||
void JNICALL ScriptMethodsTerrainNamespace::setCreatureCoverVisibility(JNIEnv * env, jobject self, jlong target, jboolean isVisible)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if(!JavaLibrary::getObject(target, creature))
|
||||
return;
|
||||
|
||||
@@ -1160,7 +1160,7 @@ void JNICALL ScriptMethodsTerrainNamespace::setCreatureCoverVisibility(JNIEnv *
|
||||
|
||||
jboolean JNICALL ScriptMethodsTerrainNamespace::getCreatureCoverVisibility(JNIEnv * env, jobject self, jlong target)
|
||||
{
|
||||
CreatureObject * creature = NULL;
|
||||
CreatureObject * creature = nullptr;
|
||||
if(!JavaLibrary::getObject(target, creature))
|
||||
return JNI_FALSE;
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetTriggeredEvents(JNIEnv * /*env*/, jobject /*self*/, jlong player)
|
||||
{
|
||||
ServerObject const * const so = safe_cast<ServerObject const *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
{
|
||||
@@ -89,7 +89,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetTriggeredEvents(JN
|
||||
VeteranRewardManager::getTriggeredEventsIds(*playerCreature, eventsIds);
|
||||
|
||||
if (eventsIds.empty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
int i = 0;
|
||||
LocalObjectArrayRefPtr valueArray = createNewObjectArray(eventsIds.size(), JavaLibrary::getClsString());
|
||||
@@ -102,7 +102,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetTriggeredEvents(JN
|
||||
return valueArray->getReturnValue();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -110,7 +110,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetTriggeredEvents(JN
|
||||
jboolean JNICALL ScriptMethodsVeteranNamespace::veteranAccountFeatureIdRequest(JNIEnv * /*env*/, jobject /*self*/, jlong player)
|
||||
{
|
||||
ServerObject * const so = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
{
|
||||
@@ -131,7 +131,7 @@ jboolean JNICALL ScriptMethodsVeteranNamespace::veteranAccountFeatureIdRequest(J
|
||||
jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesDescriptions(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring event)
|
||||
{
|
||||
ServerObject const * const so = safe_cast<ServerObject const *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
{
|
||||
@@ -152,7 +152,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesDescr
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -160,7 +160,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesDescr
|
||||
jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesTags(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring event)
|
||||
{
|
||||
ServerObject const * const so = safe_cast<ServerObject const *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
{
|
||||
@@ -181,7 +181,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesTags(
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -189,7 +189,7 @@ jobjectArray JNICALL ScriptMethodsVeteranNamespace::veteranGetRewardChoicesTags(
|
||||
jboolean JNICALL ScriptMethodsVeteranNamespace::veteranClaimReward(JNIEnv * /*env*/, jobject /*self*/, jlong player, jstring event, jstring rewardTag)
|
||||
{
|
||||
ServerObject const * const so = safe_cast<ServerObject const *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject const * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ jstring JNICALL ScriptMethodsVeteranNamespace::veteranGetEventAnnouncement(JNIEn
|
||||
return eventAnnouncement.getReturnValue();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -245,7 +245,7 @@ jstring JNICALL ScriptMethodsVeteranNamespace::veteranGetEventDescription(JNIEnv
|
||||
return eventDescription.getReturnValue();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -263,7 +263,7 @@ jstring JNICALL ScriptMethodsVeteranNamespace::veteranGetEventUrl(JNIEnv * /*env
|
||||
return temp2.getReturnValue();
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -313,7 +313,7 @@ jboolean JNICALL ScriptMethodsVeteranNamespace::veteranIsItemAccountUniqueFeatur
|
||||
void JNICALL ScriptMethodsVeteranNamespace::veteranWriteAccountDataToObjvars(JNIEnv * /*env*/, jobject /*self*/, jlong player)
|
||||
{
|
||||
ServerObject * const so = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(NetworkId(player)));
|
||||
CreatureObject * const playerCreature = so ? so->asCreatureObject() : NULL;
|
||||
CreatureObject * const playerCreature = so ? so->asCreatureObject() : nullptr;
|
||||
|
||||
if (playerCreature)
|
||||
VeteranRewardManager::writeAccountDataToObjvars(*playerCreature);
|
||||
@@ -323,11 +323,11 @@ void JNICALL ScriptMethodsVeteranNamespace::veteranWriteAccountDataToObjvars(JNI
|
||||
|
||||
jboolean JNICALL ScriptMethodsVeteranNamespace::veteranCanTradeInReward(JNIEnv *env, jobject self, jlong player, jlong item)
|
||||
{
|
||||
CreatureObject const * playerCreature = NULL;
|
||||
CreatureObject const * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature) || !playerCreature)
|
||||
return JNI_FALSE;
|
||||
|
||||
ServerObject * itemObject = NULL;
|
||||
ServerObject * itemObject = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObject) || !itemObject)
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -339,11 +339,11 @@ jboolean JNICALL ScriptMethodsVeteranNamespace::veteranCanTradeInReward(JNIEnv *
|
||||
|
||||
void JNICALL ScriptMethodsVeteranNamespace::veteranTradeInReward(JNIEnv *env, jobject self, jlong player, jlong item)
|
||||
{
|
||||
CreatureObject const * playerCreature = NULL;
|
||||
CreatureObject const * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature) || !playerCreature)
|
||||
return;
|
||||
|
||||
ServerObject * itemObject = NULL;
|
||||
ServerObject * itemObject = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObject) || !itemObject)
|
||||
return;
|
||||
|
||||
@@ -355,11 +355,11 @@ void JNICALL ScriptMethodsVeteranNamespace::veteranTradeInReward(JNIEnv *env, jo
|
||||
|
||||
void JNICALL ScriptMethodsVeteranNamespace::adjustSwgTcgAccountFeatureId(JNIEnv *env, jobject self, jlong player, jlong item, jint featureId, jint adjustment)
|
||||
{
|
||||
CreatureObject const * playerCreature = NULL;
|
||||
CreatureObject const * playerCreature = nullptr;
|
||||
if (!JavaLibrary::getObject(player, playerCreature) || !playerCreature)
|
||||
return;
|
||||
|
||||
ServerObject * itemObject = NULL;
|
||||
ServerObject * itemObject = nullptr;
|
||||
if (!JavaLibrary::getObject(item, itemObject) || !itemObject)
|
||||
return;
|
||||
|
||||
|
||||
@@ -306,7 +306,7 @@ jobject JNICALL ScriptMethodsWaypointNamespace::getWaypointRegion(JNIEnv * env,
|
||||
if(w.isValid())
|
||||
{
|
||||
const Region * region = RegionMaster::getSmallestVisibleRegionAtPoint(w.getLocation().getSceneId(), w.getLocation().getCoordinates().x, w.getLocation().getCoordinates().z);
|
||||
if (region != NULL)
|
||||
if (region != nullptr)
|
||||
{
|
||||
LocalRefPtr result;
|
||||
if (ScriptConversion::convert(*region, result))
|
||||
|
||||
@@ -182,7 +182,7 @@ const JNINativeMethod NATIVES[] = {
|
||||
* @param location location that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInRangeLocation(JN
|
||||
* @param location object that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range)
|
||||
{
|
||||
@@ -242,7 +242,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInRangeObject(JNIE
|
||||
* @param location location that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range)
|
||||
{
|
||||
@@ -271,7 +271,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInRangeLocation(
|
||||
* @param location object that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range)
|
||||
{
|
||||
@@ -302,7 +302,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInRangeObject(JN
|
||||
* @param type
|
||||
* @param mask
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range, jint type, jint mask)
|
||||
{
|
||||
@@ -333,7 +333,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInRangeLo
|
||||
* @param type
|
||||
* @param mask
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range, jint type, jint mask)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInRangeOb
|
||||
* @param range radius of search area
|
||||
* @param species
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range, jint species)
|
||||
{
|
||||
@@ -393,7 +393,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInRange
|
||||
* @param range radius of search area
|
||||
* @param species
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range, jint species)
|
||||
{
|
||||
@@ -424,7 +424,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInRange
|
||||
* @param species
|
||||
* @param race
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range, jint species, jint race)
|
||||
{
|
||||
@@ -455,7 +455,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInRangeLoc
|
||||
* @param species
|
||||
* @param race
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range, jint species, jint race)
|
||||
{
|
||||
@@ -484,7 +484,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInRangeObj
|
||||
* @param location location that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range)
|
||||
{
|
||||
@@ -513,7 +513,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInRangeLocati
|
||||
* @param location object that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range)
|
||||
{
|
||||
@@ -542,7 +542,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInRangeObject
|
||||
* @param location location that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range)
|
||||
{
|
||||
@@ -571,7 +571,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInRangeLocation(JNIEn
|
||||
* @param location object that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range)
|
||||
{
|
||||
@@ -600,7 +600,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInRangeObject(JNIEnv
|
||||
* @param location location that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPlayerCreaturesInRangeLocation(JNIEnv *env, jobject self, jobject location, jfloat range)
|
||||
{
|
||||
@@ -629,7 +629,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPlayerCreaturesInRangeLoc
|
||||
* @param location object that is the center of the search area
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPlayerCreaturesInRangeObject(JNIEnv *env, jobject self, jlong object, jfloat range)
|
||||
{
|
||||
@@ -658,7 +658,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPlayerCreaturesInRangeObj
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -698,7 +698,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInCone(JNIEnv *env
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInConeLocation(JNIEnv *env, jobject self, jlong coneCenterObjectId, jobject coneDirectionLocation, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -738,7 +738,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getObjectsInConeLocation(JNI
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -779,7 +779,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInCone(JNIEnv *e
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInConeLocation(JNIEnv *env, jobject self, jlong coneCenterObjectId, jobject coneDirectionLocation, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -820,7 +820,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesInConeLocation(J
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle, jint niche, jint mask)
|
||||
{
|
||||
@@ -860,7 +860,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfNicheInCone(JN
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle, jint species)
|
||||
{
|
||||
@@ -900,7 +900,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfSpeciesInCone(
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle, jint species, jint race)
|
||||
{
|
||||
@@ -940,7 +940,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getCreaturesOfRaceInCone(JNI
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -980,7 +980,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNonCreaturesInCone(JNIEnv
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -1020,7 +1020,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getNPCsInCone(JNIEnv *env, j
|
||||
* @param env Java environment
|
||||
* @param self class calling this function
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPlayerCreaturesInCone(JNIEnv *env, jobject self, jlong coneCenterObjectId, jlong coneDirectionObjectId, jfloat range, jfloat angle)
|
||||
{
|
||||
@@ -1169,7 +1169,7 @@ jlong JNICALL ScriptMethodsWorldInfoNamespace::getClosestMobile(JNIEnv *env, job
|
||||
return 0;
|
||||
|
||||
ServerObject * npc = ServerWorld::findClosestNPC(target, radius);
|
||||
if (npc == NULL)
|
||||
if (npc == nullptr)
|
||||
return 0;
|
||||
return (npc->getNetworkId()).getValue();
|
||||
}
|
||||
@@ -1184,7 +1184,7 @@ jlong JNICALL ScriptMethodsWorldInfoNamespace::getClosestPlayer(JNIEnv *env, job
|
||||
return 0;
|
||||
|
||||
ServerObject * player = ServerWorld::findClosestPlayer(target, radius);
|
||||
if (player == NULL)
|
||||
if (player == nullptr)
|
||||
return 0;
|
||||
return (player->getNetworkId()).getValue();
|
||||
}
|
||||
@@ -1209,7 +1209,7 @@ jlong JNICALL ScriptMethodsWorldInfoNamespace::getFirstObjectWithScript(JNIEnv *
|
||||
|
||||
for (ResultsType::iterator i=results.begin(); i!=results.end(); ++i)
|
||||
{
|
||||
if (*i != NULL && (*i)->getScriptObject()->hasScript(scriptName))
|
||||
if (*i != nullptr && (*i)->getScriptObject()->hasScript(scriptName))
|
||||
return ((*i)->getNetworkId()).getValue();
|
||||
}
|
||||
|
||||
@@ -1237,7 +1237,7 @@ jlong JNICALL ScriptMethodsWorldInfoNamespace::getFirstObjectWithObjVar(JNIEnv *
|
||||
|
||||
for (ResultsType::iterator i=results.begin(); i!=results.end(); ++i)
|
||||
{
|
||||
if (*i != NULL && (*i)->getObjVars().hasItem(objvarName))
|
||||
if (*i != nullptr && (*i)->getObjVars().hasItem(objvarName))
|
||||
return ((*i)->getNetworkId()).getValue();
|
||||
}
|
||||
|
||||
@@ -1265,7 +1265,7 @@ jlong JNICALL ScriptMethodsWorldInfoNamespace::getFirstObjectWithTemplate(JNIEnv
|
||||
|
||||
for (ResultsType::iterator i=results.begin(); i!=results.end(); ++i)
|
||||
{
|
||||
if (*i != NULL && templateStr == (*i)->getTemplateName())
|
||||
if (*i != nullptr && templateStr == (*i)->getTemplateName())
|
||||
return ((*i)->getNetworkId()).getValue();
|
||||
}
|
||||
|
||||
@@ -1434,7 +1434,7 @@ jstring JNICALL ScriptMethodsWorldInfoNamespace::getNameForPlanetObject(JNIEnv *
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1499,7 +1499,7 @@ jobject JNICALL ScriptMethodsWorldInfoNamespace::getValidLocation(JNIEnv *env, j
|
||||
|
||||
// Determine if it's a valid point, and if not search for another one.
|
||||
|
||||
bool isValid = !CollisionWorld::query( Sphere(corralPoint,objectRadius),NULL);
|
||||
bool isValid = !CollisionWorld::query( Sphere(corralPoint,objectRadius),nullptr);
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -1517,14 +1517,14 @@ jobject JNICALL ScriptMethodsWorldInfoNamespace::getValidLocation(JNIEnv *env, j
|
||||
|
||||
// We failed to find a valid location
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
jboolean JNICALL ScriptMethodsWorldInfoNamespace::getCollidesWithObject(JNIEnv * env, jobject self, jobject jlocation, jfloat jradius)
|
||||
{
|
||||
if (jlocation == NULL)
|
||||
if (jlocation == nullptr)
|
||||
return JNI_FALSE;
|
||||
|
||||
float const radius = jradius;
|
||||
@@ -1532,7 +1532,7 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::getCollidesWithObject(JNIEnv *
|
||||
if (!ScriptConversion::convertWorld(jlocation, location))
|
||||
return JNI_FALSE;
|
||||
|
||||
bool const result = CollisionWorld::query(Sphere(location, radius), NULL);
|
||||
bool const result = CollisionWorld::query(Sphere(location, radius), nullptr);
|
||||
|
||||
if(result)
|
||||
return JNI_TRUE;
|
||||
@@ -1556,7 +1556,7 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::canSee(JNIEnv *env, jobject se
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const ServerObject * sourceObject = NULL;
|
||||
const ServerObject * sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
{
|
||||
NetworkId id(source);
|
||||
@@ -1572,7 +1572,7 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::canSee(JNIEnv *env, jobject se
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
const ServerObject * targetObject = NULL;
|
||||
const ServerObject * targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
{
|
||||
NetworkId id(target);
|
||||
@@ -1608,7 +1608,7 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::canSeeLocation(JNIEnv *env, jo
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const ServerObject * sourceObject = NULL;
|
||||
const ServerObject * sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(source, sourceObject))
|
||||
{
|
||||
NetworkId id(source);
|
||||
@@ -1640,11 +1640,11 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::canManipulate(JNIEnv *env, job
|
||||
{
|
||||
UNREF(self);
|
||||
|
||||
const CreatureObject * sourceObject = NULL;
|
||||
const CreatureObject * sourceObject = nullptr;
|
||||
if (!JavaLibrary::getObject(player, sourceObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
const ServerObject * targetObject = NULL;
|
||||
const ServerObject * targetObject = nullptr;
|
||||
if (!JavaLibrary::getObject(target, targetObject))
|
||||
return JNI_FALSE;
|
||||
|
||||
@@ -1663,7 +1663,7 @@ jboolean JNICALL ScriptMethodsWorldInfoNamespace::canManipulate(JNIEnv *env, job
|
||||
* @param performer performer we are looking for listeners of
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPerformanceListenersInRange(JNIEnv *env, jobject self, jlong performer, jfloat range)
|
||||
{
|
||||
@@ -1697,7 +1697,7 @@ jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPerformanceListenersInRan
|
||||
* @param performer performer we are looking for watchers of
|
||||
* @param range radius of search area
|
||||
*
|
||||
* @return array of obj_ids of the objects in range, or null on error
|
||||
* @return array of obj_ids of the objects in range, or nullptr on error
|
||||
*/
|
||||
jlongArray JNICALL ScriptMethodsWorldInfoNamespace::getPerformanceWatchersInRange(JNIEnv *env, jobject self, jlong performer, jfloat range)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ void put(ByteStream & target, const std::vector<const std::vector<NetworkId> *>
|
||||
{
|
||||
const std::vector<NetworkId> * inner = source[i];
|
||||
signed int innerLength = 0;
|
||||
if (inner != NULL)
|
||||
if (inner != nullptr)
|
||||
innerLength = inner->size();
|
||||
put(target, innerLength);
|
||||
for (int j = 0; j < innerLength; ++j)
|
||||
|
||||
@@ -207,7 +207,7 @@ void ScriptParams::addParam(bool param, const std::string & paramName, bool owne
|
||||
* This call occurs because of a conversion of a datatype passing through this function from std::string to Unicode::String.
|
||||
* Basically, most times it is called with std::string the c_str() function is called. Since this is still valid when the
|
||||
* type is changed to Unicode::String and the const Unicode::unicode_char_t * is successfully auto-converted to const char *
|
||||
* you wind up having a NULL string when it get explicitly converted to const char * on the other side. So, this should never
|
||||
* you wind up having a nullptr string when it get explicitly converted to const char * on the other side. So, this should never
|
||||
* be called except in error.
|
||||
*
|
||||
void ScriptParams::addParam(const Unicode::unicode_char_t * param, const std::string & paramName, bool owned)
|
||||
@@ -659,7 +659,7 @@ bool ScriptParams::changeParam(int index, const StringId & param, bool owned)
|
||||
if (p.m_type != Param::STRING_ID)
|
||||
return false;
|
||||
|
||||
if (p.m_param.sidParam == NULL)
|
||||
if (p.m_param.sidParam == nullptr)
|
||||
return false;
|
||||
|
||||
if (p.m_owned)
|
||||
|
||||
@@ -311,7 +311,7 @@ inline const stdvector<const Vector *>::fwd & ScriptParams::getLocationArrayPara
|
||||
|
||||
inline const NetworkId & ScriptParams::getObjIdParam(int index) const
|
||||
{
|
||||
if (m_params[index].m_param.oidParam != NULL)
|
||||
if (m_params[index].m_param.oidParam != nullptr)
|
||||
return *m_params[index].m_param.oidParam;
|
||||
return NetworkId::cms_invalid;
|
||||
} // ScriptParams::getObjIdParam
|
||||
|
||||
Reference in New Issue
Block a user