Bug - Fixed New triggers are not saved when changing moods

When I change away from moods that include 'extends,' any non-inherited triggers that are removed, in r14967.[SUP]1[/SUP]

I can reproduce thusly:
  • Create a mood, 'test extends default'. The mood includes all triggers from mood 'default.'
  • Add a new trigger to mood 'test,'[SUP]2[/SUP] using the 'add entry' button. The new trigger shows up in the list. I can see the trigger being added to username_moods.txt.
  • Change moods using the dropdown.
  • Change back. The new trigger is gone from the list. Only the triggers inherited from mood 'default' remain in the list.[SUP]3[/SUP]
  • The trigger still shows in username_moods.txt. However, if I log out and log back in, the non-inherited triggers are removed. Only the inherited triggers remain in username_moods.txt.

[SUP]1[/SUP]This bug also exists (at least) in r14965.
[SUP]2[/SUP]This seems to happen with any trigger that I try.
[SUP]3[/SUP]The triggers also disappear if I log out and log back in without changing moods.

Halp.
 
Last edited:
Failed to replicate using r14967.

  • My mood: default.
  • Select "When an effect lost", Select "Astral Shell". Default action is "cast 1 Astral Shell"
  • Click "add entry" button, adding the selected trigger to my default mood.
  • From the drop-down I select "dreadwoods" mood.
  • From the drop-down I select "default" mood.
  • There's the action for casting astral shell when I lose it, just as I had added.

More information required.
 
Last edited:
Thanks for the further prompting, Bale.

It appears that this is actually only an issue with moods that inherit using 'extends.' Furthermore, I've discovered that the triggers are being saved correctly in the configuration file; for some reason, when switching back to a given mood, Mafia is just ignoring that file. I'm not sure whether Mafia should be reading from the file during each change, so either (1) the file is output correctly, but Mafia's not saving the change in memory correctly, or (2) Mafia is somehow not reading the file correctly during a mood change.

I've edited the first post, but I don't think I have permissions to change the title. So if a mod could do that, it would be appreciated :)
 
That's normal. I'm not even sure that this is a bug since different behavior for extends might be confusing. They're not unique moods after all.

I'll leave this open though because someone else might have a different opinion about what the proper behavior should be.
 
Wait... what? That's normal? You're saying that the intended behavior is that a mood that 'extends' will not save other triggers other than the inherited ones? My impression was that 'extends' was intended to allow a user to set MoodA, with trigger1 and trigger2, and set MoodB extends MoodA, with trigger3 and trigger4, and also trigger1 and trigger2.

What's the point of 'extends,' if it really just means 'copies?'

I'm not convinced that this is the intended behavior, but if so, I will at least assert that it's new behavior. For the many years that I've been using Mafia, I've had moods with 'extends' that nonetheless saved other, non-inherited, triggers as well.
 
What's the point of 'extends,' if it really just means 'copies?'

You can extend several different moods - so you can add triggers to one mood by also extending a special mood that's used only to contain those extra triggers.
Like
Code:
[ moodA extends mood1, mood2, moodAspecial ]

[ moodAspecial ]
unconditional => ash code_here();
 
This is still a bug, unless the behavior was supposed to changed. Adding triggers to moods that have parent moods used to work (as of r14830), and looking at Mood.java, it is definitely supposed to work. Having parentNames should not preclude a mood from also having localTriggers, and as PaladinWhite noted, the localTriggers are correctly stored to the file. I'll see if I can track this down tomorrow if no one else does.

Edit:
Having testing in r14830 and r14831, I can say that the breakage occurred there.
 
Last edited:
Back
Top