for now let's just leave this alone, maybe there is a real, proper way to fix this

This commit is contained in:
DarthArgus
2016-01-21 23:21:48 -06:00
parent 9bebf76c85
commit 0cd9d5ce67
@@ -1773,28 +1773,17 @@ void CreatureObject::initializeFirstTimeObject()
//-- Get ourselves into a reasonable locomotion state.
updateMovementInfo();
// create the default weapon
initializeDefaultWeapon();
// set the current weapon
WeaponObject * weapon = getReadiedWeapon();
if (weapon != NULL)
setCurrentWeapon(*weapon);
//Quick error check since all creatures should have a default weapon
std::string creature = getTemplateName();
//transport shuttles and other animated ships are "Creatures" but don't need weapons
//and throw warns if we try to give them one
//in their templates, most are marked "HACK" so let's just silence stuff for those
if (creature.find("object/creature/npc/theme_park") == std::string::npos)
{
// create the default weapon
initializeDefaultWeapon();
// set the current weapon
WeaponObject * weapon = getReadiedWeapon();
if (weapon != NULL)
setCurrentWeapon(*weapon);
//Quick error check since all creatures should have a default weapon
std::string creature = getTemplateName();
WARNING_STRICT_FATAL(!getDefaultWeapon(), ("Creature %s (%s) has no default "
"weapon", getNetworkId().getValueString().c_str(), getTemplateName()));
}
WARNING_STRICT_FATAL(!getDefaultWeapon(), ("Creature %s (%s) has no default "
"weapon", getNetworkId().getValueString().c_str(), getTemplateName()));
const ServerCreatureObjectTemplate * myTemplate = safe_cast<const ServerCreatureObjectTemplate *>(getObjectTemplate());
Unicode::String newName = NameManager::getInstance().generateRandomName(ConfigServerGame::getCharacterNameGeneratorDirectory(), myTemplate->getNameGeneratorType());
@@ -3020,7 +3009,7 @@ void CreatureObject::initializeDefaultWeapon()
if (weaponTemplate == NULL)
{
WARNING(true, ("Creature template %s has no valid default weapon!", getTemplateName()));
// try to use the fallback weapon
weaponTemplate = dynamic_cast<ServerWeaponObjectTemplate const *>(ObjectTemplateList::fetch(ConfigServerGame::getFallbackDefaultWeapon()));
@@ -3030,15 +3019,12 @@ void CreatureObject::initializeDefaultWeapon()
WeaponObject * const weapon = safe_cast<WeaponObject *>(ServerWorld::createNewObject(*weaponTemplate, *this, s_defaultWeaponSlotId, false));
if (weapon != NULL)
{
weapon->setAsDefaultWeapon(true);
}
#ifdef _DEBUG
else
{
WARNING_STRICT_FATAL(true, ("CreatureObject::initializeDefaultWeapon unable to create default weapon %s for creature %s", weaponTemplate->getName(), getNetworkId().getValueString().c_str()));
}
#endif
weaponTemplate->releaseReference();
}
}