Inconsistent Superload/overload addon behavior

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Inconsistent Superload/overload addon behavior

#1 Post by Hachem_Muche »

If 2 add-ons try to superload the same function, only the first load (lowest priority) succeeds and later loads are ineffective. For typical composite add-ons, this can result in only parts of each add-on being loaded, leading to unpredictable behavior.

As an example, I have attached 2 different add-ons (Sample1, weight 150, and Sample2, weight 100) that superload and overload the same 2 functions.

Sample1 overloads the Yeek Birth intro text, adding "YEEK! You're playing a YEEK! (1)"
and superloads the function mod.class.Actor.lua:canBe(what) adding "%s is tickled! (1)" in response to what == "tickle"

Sample2 overloads the Yeek Birth intro text, adding "Are you sure you want to play a YEEK? They're wimpy and weird (2)"
and superloads the function mod.class.Actor.lua:canBe(what) adding "%s is NOT ticklish! (2)" in response to what == "tickle"

With both files loaded, the game uses the birth code from Sample1 and the Actor.lua code from Sample2.
Attachments
tome-Sample2.zip
(3.78 KiB) Downloaded 128 times
tome-Sample1.zip
(3.75 KiB) Downloaded 136 times
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Inconsistent Superload/overload addon behavior

#2 Post by darkgod »

fixed
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Post Reply