I have isolated where this problem occurs in the game code and have figured out how it could be fixed. To test this I, since I have Get Famous already and to verify the problem more thoroughly, have artificially created a situation where the error would occur, but more on that in a bit.
The issue lies in the update_royalties_and_get_payed method of the RoyaltyTracker class. Specifically in this part of the code:
for (royalty_type, royalty_list) in self._royalties.items():
bonus_buff = None
bonus_multiplier = None
bonus_royalty = RoyaltyTracker.ROYALTY_TYPE_DATA.get(royalty_type).one_time_bonus
if bonus_royalty is not None:
bonus_buff = bonus_royalty.bonus_buff.buff_type
if sim_info.Buffs.has_buff(bonus_buff):
bonus_multiplier = bonus_royalty.bonus_multiplier
for royalty in reversed(royalty_list):
royalty_tuning = RoyaltyPayment.get_royalty_payment_tuning(royalty.royalty_guid64)
if royalty_tuning is None:
logger.error('royalty_tuning is none for sim {}. royalty: {}.', sim_info, royalty)
elif royalty.update(royalty_tuning):
payment_tag = royalty_tuning.payment_tag
payment_amount = RoyaltyTracker.get_payment_amount(royalty, royalty_tuning)
if bonus_multiplier is not None:
payment_amount *= bonus_multiplier
royalty_payment_dict[royalty] = payment_amount
if payment_tag not in tag_payment_map:
tag_payment_map[payment_tag] = 0
tag_payment_map[payment_tag] += payment_amount
else:
royalty_list.remove(royalty)
if bonus_multiplier is not None:
sim_info.Buffs.remove_buff_by_type(bonus_buff)
The issue is that this code assumes that the buff will exist if the given royalty type has a one time bonus, but this is not always the case. Specifically, especially for those who use Island Living, licensing Nature Documentaries counts towards video recoding type royalties, which have a one time bonus that references a buff from Get Famous. It is likely this could happen to a Sim downloaded from the gallery who had video recording royalties, but I don't know for sure if that data is saved over the gallery; it may not be.
In any case, to test this, I overrode the XML code that defines the ROYALTY_TYPE_DATA variable and basically recreated a scenario where a Sim I played had royalties that had a one time buff bonus but the buff didn't exist, and I got the exact same error.
The fix for this would be relatively simple, as this is more or less an oversight. Something alone the lines of this, were the code ensures that the buff exists before trying to access any of its properties would work.
bonus_royalty = RoyaltyTracker.ROYALTY_TYPE_DATA.get(royalty_type).one_time_bonus
if bonus_royalty is not None:
bonus_buff = bonus_royalty.bonus_buff
if bonus_buff and sim_info.Buffs.has_buff(bonus_buff.buff_type):
bonus_multiplier = bonus_royalty.bonus_multiplier
I have applied a fix on my own that does this after creating a scenario in which this error would manifest and the bug went away and my Sims successfully got their royalty payments again.
I cannot link the fix myself, but it does seem to fix the error without causing any problems.