Brief: I am proposing to remove the return value checking on Item's equip/unequip script because it is redundant and misleading.
The problem:
Actually every equippable item can have 4 relevant scripts:
- an equipTest script
- an equip script
- an unequipTest script
- an unequip script
The general assumption is the following: when the core wants to (un)equip and item it calls the test script, checks its return value, then calls the (un)equip script, checks its return value and finally (un)equips the item.
This is overly complicated and not always true, since on death, the unequiptest script it not called and the unequip script return value is ignored. I would bet there are more similar situations.
A typical equip script will stop its processing when returning 0 and will not perform the required (un)equip actions, assuming the core will not (un)equip the item. When the core (un)equips the item anyway, this could lead to bugs.
Since the only reason for an (un)equiptest script to exis is to check whether an item can be unequipped or not, I see no reason to have this redundant feature also in the (un)equip script.
The proposed solution:
What I have in mind is a straightforward simplification and division of roles.
- The core will call the (un)equip test script only when it intends to obey its returns value. A scripter can assume that when the script is called and 0 is returned, the item will not be (un)equipped and the (un)equip script will not be called at all. The "test" script will be only responsible to check for item (un)equippability.
- The (un)equip script will be called when the item is about to be (un)equipped, regardless of the fact that the "test" script has been called or not. Its return value will be ignored and it will only be responsible to perform needed (un)equip actions.
Do you think that's a good idea/improvement?
Proposal: return value of equipscript should not be checked
Here you can post threads specific to the current release of the core (099)
Return to “Current stable release (099)”
Jump to
- Contrivance
- ↳ POL Server Website
- ↳ General Discussion
- ↳ Rants
- Novice & Help Area
- ↳ Hello world
- ↳ General Help
- ↳ Scripting Help
- ↳ Guides
- ↳ First steps
- Official POL Distribution (Distro)
- ↳ Development Discussion
- ↳ Distro Bug Reports
- ↳ Test shard
- ↳ Contribute to the distro
- ↳ Contributed Optional Packages and Scripts for the Distro
- Core Discussions
- ↳ Current development (100)
- ↳ Current stable release (099)
- ↳ Bug Reports & Feature Requests
- ↳ Solved issues
- ↳ Old requests
- ↳ Contribute to the core
- 3rd Party Scripts
- ↳ Contributed Scripts & Packages
- ↳ Complete Worlds
- 3rd Party Software
- ↳ POL Tools
- ↳ UO Tools
- ↳ Packet World
- ↳ Hosted Projects
- ↳ UOFiddler
- General Shard Development
- ↳ Miscellaneous Development Discussion
- Archive
- ↳ Older Core Versions
- ↳ POL Core 095
- ↳ General Help (095)
- ↳ POL Core 096
- ↳ General Help (096)
- ↳ POL Core 097
- ↳ Feature Request Archive
- ↳ General Help (097)
- ↳ Bug Reports (097)
- ↳ Solved Bugs (097)
- ↳ POL Core 098
- ↳ General Help (098)
- ↳ Bug Reports Archive (098)
- ↳ Old distros
- ↳ POL Core Patch Submissions
- ↳ Distro Patch Submissions