-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define minimum weight (prevent negatives) #73
Comments
Is negative weight an ACTUAL thing? Should we treat any negative value as something special and default to weight of 0? What happens on actual UO servers? |
I've never seen such functionality on offical servers and negative weight sounds weird. This feature can be done with overriding TotalWeight property |
So I will keep this as a bug, and we should default any negative number to 0. Overriding that can be done on a per item basis by overriding the weight functions I assume. This is up for grabs for anyone that wants to fix it. :) Edit: is weight an int or uint to the client? Let's find out. |
Two quick changes should fix this and stop the attribute settings from the [props menu. In Item.cs inside the "public double Weight" (around line 496) You need to change:
to:
and also in Item.cs inside the "VerifyCompactInfo()" (around line 1724) You need to change:
to:
|
Hey, in my tinkering with runuo 2.5 and 2.6 i noticed that if negative weight compounded beyond a certain limit it would default to max weight. I wanted to make a bag that would randomly generate with a weight from 1 to -150 and thus would allow an extra 100 ores (in that area). I got the bag to spawn off of an npc vendor but when i started bug checking the bag i ran into all kinds of default weight errors.
Things i noticed:
Stacking negitive weight bags with no other items would additionally subtract weight through the chain of bags until the player weight reached some sort of threshold and defaulted to max weight.
Having multiple items in a bag with negative weight subtracted as it should but the weight modifier could not keep up with alot of fast changes (bag sorting, pot use, so on) and defaulted to max weight.
Negative weight bags on pets with pack did nothing so far as i could see.
So i concluded that deffing a minimum negative weight would resolve most of the issues i was having the consequence i was going to use was not being able to pick items off of the ground if player weight fell below a minimum weight. Thus using it would require planning.
I searched around alot for similar errors but never really found a good solution.
The last thing i was working on was getting the player total weight and subtracting 200 if the weight exceeded the players carry capacity before stamina burn.
Ill post my scripts on runuo's git when i can. I figured that if your going to rework the entire arcitecture deffining minium weight and some negitive handeling would prevent alot of needless crashing.
Excuse by bad spelling.
The text was updated successfully, but these errors were encountered: