mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-29 23:15:56 -04:00
Revert "screw this, seems default weapons just are busted for some "creatures" even if said creature is a shuttle"
This reverts commit 0a27156c59.
This commit is contained in:
@@ -1773,19 +1773,28 @@ 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);
|
||||
|
||||
#ifdef _DEBUG
|
||||
//Quick error check since all creatures should have a default weapon
|
||||
WARNING_STRICT_FATAL(!getDefaultWeapon(), ("Creature %s (%s) has no default "
|
||||
"weapon", getNetworkId().getValueString(), getTemplateName()));
|
||||
#endif
|
||||
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(), creature));
|
||||
}
|
||||
|
||||
const ServerCreatureObjectTemplate * myTemplate = safe_cast<const ServerCreatureObjectTemplate *>(getObjectTemplate());
|
||||
Unicode::String newName = NameManager::getInstance().generateRandomName(ConfigServerGame::getCharacterNameGeneratorDirectory(), myTemplate->getNameGeneratorType());
|
||||
@@ -3011,9 +3020,9 @@ void CreatureObject::initializeDefaultWeapon()
|
||||
if (weaponTemplate == NULL)
|
||||
{
|
||||
std::string creature = getTemplateName();
|
||||
#ifdef _DEBUG
|
||||
|
||||
WARNING(true, ("Creature template %s has no valid default weapon!", creature));
|
||||
#endif
|
||||
|
||||
// try to use the fallback weapon
|
||||
weaponTemplate = dynamic_cast<ServerWeaponObjectTemplate const *>(ObjectTemplateList::fetch(ConfigServerGame::getFallbackDefaultWeapon()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user