UOGamers Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • To obtain new Razor updates, please reinstall Razor from our new website.

[COMPLETE] Container Issues

Status
Not open for further replies.
[COMPLETE] Container Issues

There is still a matter about :(

Quoting from MalGanis' SVN bugtracking: http://code.google.com/p/mondains-l...us Priority Component Milestone Owner Summary

What steps will reproduce the problem?
1.make a backpack and place it on the ground and weight is 400 stone max.
2.pick up and place in your backpack and weight goes to 550 stone max.
3.put the backpack back on the ground and max weight goes back to 400
stones even if you have loaded it up to the max of 550 while in your
backpack on your paperdoll.(Properties shows "(however many items
inside)/125 Items 550/400 Stones)

What is the expected output? What do you see instead?
Well...kinda guessing this might cause issues. If it has no way of crashing
a server, I really don't care.I looked at container.cs from RunUO and from
Mal, the root parent is in RunUO, Mals seems to be short and to the point.
But both have the same issue - over max weight when removed from player
backpacks if more them 400 stones is in the container.

What version of the product are you using?
RunUO 319 ML47 - the latest of both.

Please provide any additional information below.
If this really is not an issue that is going to cause bad things to happen,
eh, fine with me, just want to be sure :]

Koluch
 

psz

Administrator
Re: Backpacks! Backpacks have still a weight error!!

This has been tested on Demise?
 
Re: Backpacks! Backpacks have still a weight error!!

to be much precise... this affect "containers", not only backpacks. So also bags, boxes...
 

psz

Administrator
Re: Backpacks! Backpacks have still a weight error!!

And now you see why the RunUO devs didn't just use Mag's code:

It's not fully funcitonal ;->
 
Re: Backpacks! Backpacks have still a weight error!!

psz;563856 said:
And now you see why the RunUO devs didn't just use Mag's code:

It's not fully funcitonal ;->

infact it's NOT Malg's code! It's "OUR" code.
They got it and found the error... I was a bit lazy to write a report so I pasted theirs.

As they continue:
This is not due to MalGanis. This is a RunUO thing....

According to the backpack script the only time it should max weight 550 is when in
players pack or is players backpack.

I think that RunUO Devs meant for only the players backpack should have max weight of
550 and not containers within players pack.

This is a bug related to the attempt to update the backpack weight from 400 to 550.
 

psz

Administrator
Re: Backpacks! Backpacks have still a weight error!!

Ahh, I saw the bit where it was tested with the ML code, and thought it was something with thiers.
 

WarUO

Sorceror
Re: Backpacks! Backpacks have still a weight error!!

This was like this before you made the change to the back packs I believe. It also happens when you put any container inside your pack animal the container goes to 1600/1600 then when you take it out of the animal and you drop it on the ground it goes to 1600/400
 

psz

Administrator
Re: Backpacks! Backpacks have still a weight error!!

So.... This is an older RunUO Container bug, not a new Backpack bug?

(Or am I misunderstanding?)
 
Re: Backpacks! Backpacks have still a weight error!!

psz;564082 said:
So.... This is an older RunUO Container bug, not a new Backpack bug?

(Or am I misunderstanding?)

Looks like previous posts about reportings about gone deleted, I'll try to go for memory:

- with SVN 315 there is the attempt to raise backpacks max weight from 400 to 550. This caused problems like: when secured, the max weight was still 550.
Maybe the fact "if I put on floor it indicates me 400" was at that time but I don't remember. I remember the fact "it reports max weight 0 (infinite) only if it is in another secured container that is not a backpack".

- with SVN 319 Mark tries to fix this by changing the override line:
Code:
        public override int DefaultMaxWeight {
            get {
                if ( Core.ML ) {
                    Mobile m = ParentEntity as Mobile;
                    if ( m != null && m.Backpack == this ) {
                        return 550;
                    } else {
                        return base.DefaultMaxWeight;
                    }
                } else {
                    return base.DefaultMaxWeight;
                }
            }
        }

What is happening is backpacks and containers in general to "inherit" the maxweight:
- if they are related to the "secured family", they report 0 (infinite)
- if they are related to nothing (on floor) = 400
- to "players" (on their backpack) = 550
- to animals that carry the strong backpack with 1600 stone capacity = 1600.

That's all folks :)
 

psz

Administrator
Re: Backpacks! Backpacks have still a weight error!!

Right, but based on what WarUO said, I have to ask: Is this a bug caused by the new backpack code or was this a pre-existing bug in RunUO that just slipped by, and the new code exposed it?
 
Re: Backpacks! Backpacks have still a weight error!!

psz;564218 said:
Right, but based on what WarUO said, I have to ask: Is this a bug caused by the new backpack code or was this a pre-existing bug in RunUO that just slipped by, and the new code exposed it?

Sincerely, as I said when SVN 315 came out, I don't believe a little override caused all of this. I suspect (but I'm not certain) this bug was pre-existing and the new fixes exposed it.
 

WarUO

Sorceror
Re: Backpacks! Backpacks have still a weight error!!

This has always been like this, I think some one should check OSI and there pack animals and containers.
 

LadyCrimson

Wanderer
Re: Container Issues

Did some testing for Nikki today:

1. Horde Minions should only carry 400 stones MAX
2. Containers that are not a player backpack should only hold a max weight of 400 stones when not secured in some fashion
3. Containers that are not secured in some fashion are restricted to the max 400 stones
4. When a container is brought into a players pack, the max weight should not change from 400 to 550.
5. Containers over the limit of the pack animals weight cannot be added to it.
6. The only time the max weight of a container doesn't "count" is if it is secured or in a bank box; however, bags over their weight limit cannot be added to pack animals nor do pack animals count as a secure location where another container within can have items added to it over the weight limit
 
Re: Container Issues

so, looks like the entire way to fix it was a mistake. Maybe a new kind of backpack (i.e. "Player Backpack") with 550 stones should be created?

And then, how to substitute old ones without involving GMs? I wonder if the "substitution" can be done when the player dies and got resurrected.
 

Nikki_Demise

Bug Hunter
Re: Backpacks! Backpacks have still a weight error!!

psz;564082 said:
So.... This is an older RunUO Container bug, not a new Backpack bug?

(Or am I misunderstanding?)

Correct

The bug to overload packs is in the core. Below is a core mod to only inherit weight limit if the parent container has no weight limit.

Code:
Index: Items/Container.cs
===================================================================
--- Items/Container.cs    (revision 321)
+++ Items/Container.cs    (working copy)
@@ -108,21 +108,14 @@
         {
             get
             {
-                int maxWeight;
-
-                if ( Parent is Container )
+                if ( Parent is Container && ((Container)Parent).MaxWeight == 0 )
                 {
-                    maxWeight = ((Container)Parent).MaxWeight;
-
-                    if ( maxWeight > 0 )
-                        maxWeight = Math.Max( maxWeight, DefaultMaxWeight );
+                    return 0;
                 }
                 else
                 {
-                    maxWeight = DefaultMaxWeight;
+                    return DefaultMaxWeight;
                 }
-
-                return maxWeight;
             }
         }
Below: Fix for 2 issues
1. Only player Backpacks should be increased to 550 limit not all mobiles
2. Horde Minions should carry a normal 400 limit pack not 1600

Code:
Index: Items/Containers/Container.cs
===================================================================
--- Items/Containers/Container.cs    (revision 321)
+++ Items/Containers/Container.cs    (working copy)
@@ -194,7 +194,7 @@
             get {
                 if ( Core.ML ) {
                     Mobile m = ParentEntity as Mobile;
-                    if ( m != null && m.Backpack == this ) {
+                    if ( m != null && m.Player && m.Backpack == this ) {
                         return 550;
                     } else {
                         return base.DefaultMaxWeight;
Index: Mobiles/Familiars/HordeMinion.cs
===================================================================
--- Mobiles/Familiars/HordeMinion.cs    (revision 321)
+++ Mobiles/Familiars/HordeMinion.cs    (working copy)
@@ -45,7 +45,7 @@
             if ( pack != null )
                 pack.Delete();
 
-            pack = new StrongBackpack();
+            pack = new Backpack();
             pack.Movable = false;
 
             AddItem( pack );
 

Attachments

  • Containers.zip
    839 bytes · Views: 4
Re: Container Issues

Tested.

Core mod + player modification = works well. A really little glitch is: if you, as GM, delete the backpack of a player, then the player takes a backpack from ground, the new backpack will report 400 stones. But it will change to 550 as you pick a item or re-log in.
Horde Minion: ok. Due to OSI tests, I have also changed the UOGuide page that reported "they can carry ??? stones" :)
http://www.uoguide.com/index.php?title=Horde_Minion&action=history

Ok, it's ready to be implemented!

edit: forgot to say I have tested it also in SE and AOS era and the player backpack can carry 400 as meant to be.
 
Status
Not open for further replies.
Top