Closed toconnell closed 4 years ago
Looks like we're getting pranked by some older code that checks asset dictionaries' type value and is unaware of the new, more specific _subtype:
From the rm_monster()
method of the Settlement object:
# figure out what type it is or die trying
m_type = m_dict['type']
if m_type == 'quarry':
target_list = self.settlement['quarries']
elif m_type == 'nemesis':
target_list = self.settlement['nemesis_monsters']
else:
raise utils.InvalidUsage(
"%s Unable to process 'rm_monster' operation on asset: %s" % (
self, m_dict
)
)
I'm thinking that the fix here is probably just to switch to _subtype, but I kind of want to meditate on that before I pull the trigger.
Updated the error to be more descriptive:
This is resolved:
@@ -820,27 +821,43 @@ class Settlement(models.UserAsset):
m_dict = self.Monsters.get_asset(monster_handle)
# figure out what type it is or die trying
- m_type = m_dict['type']
+ m_type = m_dict['sub_type']
From user email
[5af899b28740d936be7dbcd6] has submitted an error report!
The report goes as follows: Can't remove a quarry selected by error (Phoenix)
Looks like
rm_monster()
might be having some timing issues or maybe is POSTing twice?