Possible bug with custom outfits?

Theraze

Active member
From looking at line 660 in request/EquipmentRequest, it appears that custom outfits are supposed to verify whether or not they're equipped, and if so, not attempt to be worn, just like normal outfits (with their check happening in line 630). However, in my attempt to add a new equipped_outfit check, I noticed that it doesn't appear to be doing the check properly...
> ash equipped_outfit("Mining Gear")

Returned: true

> ash equipped_outfit("Testing")

Returned: true

> ash equipped_outfit("Tesg")

Returned: false

> outfit testing

Putting on outfit: Testing
Equipment changed.

> ash equipped_outfit("Mining Gear")

Returned: false

> ash equipped_outfit("Testing")

Returned: true

> outfit mining gear

Putting on outfit: Mining Gear
Equipment changed.

> outfit mining gear

> ash equipped_outfit("Testing")

Returned: true

> outfit testing

Putting on outfit: Testing
Equipment changed.

> outfit testing

Putting on outfit: Testing
You are already wearing "Testing."

The message
You are already wearing "Testing."
shouldn't come up if the outfit check is running properly... it should act just like running outfit mining gear repeatedly does... a return null and no response. I think the isWearingOutfit check is failing, causing it to try to reequip the currently worn gear.

I'm posting here first because I'm not sure if this is a bug or if I'm misreading the code, and I'd prefer not to disrupt the devs if this is actually the way it's supposed to behave. :)

For the record, outfit Testing is my mining gear outfit with the asparagus knife instead... it properly equips the knife when I wear it (making it no longer the mining gear outfit), but it detects as being the worn outfit still following.

Another little quote:
> outfit birthday suit

Taking off everything...
Everything removed.

> ash equipped_outfit("Testing")

Returned: true

Since this is an unreleased function (as yet), here's what it does:
Same getMatchingOutfit as have_outfit.
For return value, changed hasOutfit(so.getOutfitId()) to isWearingOutfit(so) which should work properly.
Note that have_outfit uses getOutfitId() which won't return a value for custom outfits... however, finding outfits can be tested with so.toString() to display the names...
 
Last edited:

jasonharper

Developer
Mafia does not track the contents of custom outfits (and it would require an extra server hit per login to do so). Since a custom outfit contains no known equipment, isWearing() always returns true for them, which is precisely why that function wasn't publicly available.
 

Theraze

Active member
Ah... that makes sense. Sorry... I was trying to come up with a function that skips the server hit of someone equipping their outfit to test if it's already on. Guess that doesn't help since standard outfits are basically exclusive and customs don't save like that... *sighs* Guess the equipped_outfit function goes away as well. :D
 
Top