project-navigation
Personal tools

Author Topic: Solving the inventory bug...?  (Read 7618 times)

Rani

  • Guest
Solving the inventory bug...?
« on: September 07, 2006, 10:54:49 pm »
Well, I was able to make the floor inventory
behave itself after a soldier's death, but
only after transmitting each item move over to the client.
(inventoryDel and inventoryAdd).

I'm asking for advice on two things:

1. How much traffic would it induce? Is it a viable solution?

2. What the solution means, is that either "G_CheckVis(floor, qtrue);"
    doesnt (and shoudlnt) transmit two or more items' movemnt
    over the net, or it is broken.
    Could someone verify one or the other?
    Does someone know what it DOES trassmit? I'v seen only
    "perish events" there.

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #1 on: September 08, 2006, 07:32:15 am »
You are somewhat cryptic here, but I'll try to check that soon, understand your comment and respond. Do you run the latest SVN? Because there where changes lately that fixed a part of the inventory bug (I hope). But still dropped items disappear, until you walk away and back.

I tried to transmit to the client not the floor, as is currently, but the soldier's inventory and run the G_CheckVis on the soldier, not floor. But for some reason soldiers started mission with no inventory at all, so this needs some more care .:)

Rani

  • Guest
Solving the inventory bug...?
« Reply #2 on: September 08, 2006, 08:48:48 am »
Thats exactly the bug im talking about.

however , my solution so far seems to work
if the dying actor has no armor.

[whats up with the armor breaking everything? :) ]

If i'm able to fix it, i'll post my solution.

Edit: this is kind of emberresing.. It seems to be
working for all soldiers excet 9 and 10 -
when they drop something [where another soldier has died], its still disappears.

I need to check what is the status of that in the svn.  :roll:

Another edit: Same thing in svn version. All this time i was trying to
fix the wrong function. What is it about entities 9 and 10
that make thier drops on dead bodies buggy?

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #3 on: September 08, 2006, 09:13:08 pm »
Quote from: "Rani"
[whats up with the armor breaking everything? :) ]


Armor is supposed to disappear when dropped. This is inentional.

Quote
It seems to be working for all soldiers except 9 and 10 - when they drop something [where another soldier has died], its still disappears. [...]
What is it about entities 9 and 10 that make thier drops on dead bodies buggy?


Wow. That's news! 9 and 10 in which numbering?

dimon37

  • Guest
Solving the inventory bug...?
« Reply #4 on: September 08, 2006, 10:00:30 pm »
why should armor disapear if dropped?

Rani

  • Guest
Solving the inventory bug...?
« Reply #5 on: September 09, 2006, 01:37:17 am »
Thats 9 and 10 in entity numbering.

Also, this appears to be a gui bug, as far as my tests go,
since both the inventory lists seems to be even
(up to the order of stuff) in client and server.

I'll keep investigating.

Edit:
apperantly,the first item in menuInventory points to a constant element
in the inventory list [first item which was droped on death], instead to the first element.

So items "disappear" , but reappear when that item (the first
that was droped by the dying soldier - most usually the primary weapon)
is moved, and so moved to the head of the list, they "reappear"
as the menuInventory again points to the head of the list.

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #6 on: September 09, 2006, 02:14:53 am »
Quote from: "dimon37"
why should armor disapear if dropped?


I don't remember. :)

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #7 on: September 09, 2006, 02:18:08 am »
Quote from: "Rani"
Thats 9 and 10 in entity numbering.


Interesting. 9 and 10? Wow.


Quote
Also, this appears to be a gui bug, as far as my tests go,
since both the inventory lists seems to be even
(up to the order of stuff) in client and server.


Yes, I hope what remains to be fixes is only the problem with what is visible. I hope no items disappear, any more...

Quote
apperantly,the first item in menuInventory points to a constant element
in the inventory list [first item which was droped on death], instead to the first element.


Great. If you are right, we are almost done. Do you have a patch? BTW, come over to IRC --- it's much easier to debug together on IRC...

Rani

  • Guest
Solving the inventory bug...?
« Reply #8 on: September 09, 2006, 02:25:57 am »
I'm nerrowing in on the bastartd.
Looks like MN_Drag is the problem.

It adds the item to the Inv, but does not update
menuInventory.

Edit: no, thats not it. :\

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #9 on: September 09, 2006, 02:34:20 am »
Keep on biting! :)

Rani

  • Guest
Solving the inventory bug...?
« Reply #10 on: September 09, 2006, 03:54:02 am »
Well , to fix the symptom it is possbile in
function CL_InvAdd [cl_parse, line 826]

change
Code: [Select]

if ( container == csi.idRight )
le->right = item.t;
else if ( container == csi.idLeft )
le->left = item.t;


to
Code: [Select]

if ( container == csi.idRight )
le->right = item.t;
else if ( container == csi.idLeft )
le->left = item.t;
else if ( container == csi.idFloor )
menuInventory->c[csi.idFloor]=le->i.c[csi.idFloor];


Howver, i cant ,on the life of me, undertand what is
cousing the problems in the first place.

I'd be happy to hear ideas.

Edit: This *might* couse a bug that will enable
you to see someone else's drops to floor and pickups
if you keep the inventory screen open during thier turn.
I dont understand the network protocol enough
to know if this actually will happen.
Needs to be checked.

Another dit: Thinking a bit about it, I'm pretty sure it will cause
this bug, and wil also screw up panic/mind control drops.
I'll try to find a better solution.

Offline Bandobras

  • Captain
  • *****
  • Posts: 586
    • View Profile
Solving the inventory bug...?
« Reply #11 on: September 09, 2006, 10:40:07 pm »
Your patch 1555228 tweaked by me seem to have solved the bug. A pleasure working with you, especially on IRC. :)