Nothing entered.
[http://sourceforge.net/p/ufoai/bugs/2221 Item 2221] imported from sourceforge.net tracker on 2013-01-28 19:26:38
ERROR: Game Error: Could not find item in inventory of ent 11 (type 2) at 1:0
this error occured while trying to pick up a mono knife and put it in the belt of my solider. The knife appeared in the belt of my soldier but another version was put out-of-place in the floor container. when i try to pick that one up, too - i get the above mentioned error.
===== Comments Ported from Sourceforge =====
====== tlh2000 (2009-12-11 06:50:07) ======
When I search for the items of a killed enemy, I drag&drop all to my inventory. But then, in the enemy inventory the same items are "duped". I think this is not happening always. If I try to drag&drop another time the same, it crashes. And if I pass and close the window, it goes to the save/load menu, where if I click in "Continue", it shows me the world map, with the mission and the airship in the same point. Finally it crashes when I click in the mission.
The message log I get is like this:
********************
ERROR: LE_NotFoundError: Could not get LE with entnum 75 (src/client/battlescape/events/event/world/e_event_entperish.c:44)
********************
====== tlh2000 (2009-12-13 22:09:14) ======
G_ActorInvMove might be the root of the evil here
====== tlh2000 (2009-12-15 19:05:46) ======
also see #2896910
G_ActorInvMove: "Other players receive weapon info only." - but if the
target container is the floor G_VisToPM(floor->visflags) is used to add the
item - so this is send twice for some players, no?
====== tlh2000 (2009-12-24 11:12:35) ======
answer to myself: no, as the from and to containers are only send to others
if they are the left or the right container.
====== *anonymous (2009-12-25 22:20:01) ======
Reproduction:
When doing the mission send one soldier for a long walk (can decrease the
agent speed for easier reproduction). Select another one, drag some item
somewhere else, nothing happens, do the same dragging again. BAM! Crash!
ERROR: Game Error: Could not find item in inventory of ent 2 (type 2) at
0:2
********************
Shutdown server: Server crashed.
====== tlh2000 (2009-12-26 06:31:22) ======
that is good news - thanks. finally a way to reproduce it, this should help us to fix it.
====== aduke1 (2009-12-29 20:55:21) ======
tlh2000,
did that happen on one of your slower machines ? I can't seem to reproduce it here.
From your original post: "was put out-of-place" ? Not sure what this means. Plz clarify.
====== tlh2000 (2009-12-29 21:02:55) ======
it only happens in rare cases while moving stuff around - the hope was that the below mentioned use case could reproduce this in a reliable way. if not, we are standing at the beginning again.
====== aduke1 (2009-12-29 21:07:52) ======
Uhmm...that did not really answer my questions ;)
====== tlh2000 (2009-12-30 07:43:21) ======
nope it wasn't on a slow machine - but a rather fast one.
out of place means, that the item was placed at coordinates 0,0 in the floor container, but 0,0 is not valid for the floor container because the shape of that particular container does not allow to put anything to 0,0
so it might be that the item pointer is just not reset somewhere but the item itself it in the hand (left or right) at 0,0
====== voovoos (2009-12-30 14:05:52) ======
If 0,0 is not valid for floor container, why can't we make that conditional in Com_AddToInventory() - if (x=0 && y=0 && INV_IsFloorDef(container)) - at least that would stop the game from reporting error. *If* this is the case.
====== tlh2000 (2009-12-30 15:38:04) ======
i suppose that does not work - as this looks like a wrong pointer. i'm sure it would just fail afterwards then.
====== voovoos (2009-12-30 16:53:13) ======
What looks like wrong pointer? Anyway, such conditional works here, as container is floor and x & y are positions. Additionaly, I don't understand the behaviour: adding some printfs after (if (INV_IsFloorDef(container)) and killing soldier with 5 items (launcher, two launcher ammos, smg and smg ammo) will result in Com_AddToInventory() giving this output::
2009/12/30 17:37:52 Com_AddToInventory(): added item to floor on positions -1 -1 (grenl).
2009/12/30 17:37:52 Com_AddToInventory(): added item to floor on positions -1 -1 (grenl_ammo).
2009/12/30 17:37:52 Com_AddToInventory(): added item to floor on positions -1 -1 (grenl_ammo).
2009/12/30 17:37:52 Com_AddToInventory(): added item to floor on positions -1 -1 (smg_ammo).
2009/12/30 17:37:52 Com_AddToInventory(): added item to floor on positions -1 -1 (smg).
2009/12/30 17:37:53 Com_AddToInventory(): added item to floor on positions 9 0 (smg).
2009/12/30 17:37:53 Com_AddToInventory(): added item to floor on positions 8 0 (smg_ammo).
2009/12/30 17:37:53 Com_AddToInventory(): added item to floor on positions 7 0 (grenl_ammo).
2009/12/30 17:37:53 Com_AddToInventory(): added item to floor on positions 2 0 (grenl).
I understand that positions -1 -1 are being set in G_InventoryToFloor() (calling Com_AddToInventory() with NONE NONE values), but where is the second launcher ammo? There is only one on the floor, when I move soldier there. Now, the interesting part: I can pick the one and put into belt, then I can drop it. But I can't do it again - I can't pick that ammo second time (trying to move it to belt returns the model into floor container). Always reproducable. With any other item in that floor edict everything is OK.
====== tlh2000 (2009-12-30 21:33:55) ======
voovoos found this
====== aduke1 (2009-12-30 22:03:29) ======
Is there a limit for the floor ? # of items ?
I'm asking coz I found this for G_InventoryToFloor():
* @brief Move the whole given inventory to the floor and *destroy* the items that do not fit there.
Might explain the missing 2nd ammo....
====== voovoos (2009-12-30 22:18:47) ======
Should be fixed in r27689.
====== sf-robot (2010-01-14 02:20:12) ======
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
====== tlh2000 (2010-02-05 06:43:04) ======
I am able to make the issue occur,
1. play a skimish map
2. kill an enemy
3. pick up the items, and place them into your pack into
different slots.
this may cause the error to occur. it takes a few items.
I think the issue has something to do with the magical
stacking of items when looking at the tile the enemy died on.
ie if the alien drops 2 ammo, when you look at the floor,
you
see 1 item, but when you move the first item to your
inventory, the item on the floor is still there (the 2nd
piece of ammo).
when an alien dies, you should see each item on the floor
spread out, not stacked. does that make sense?
====== aduke1 (2010-02-16 17:20:53) ======
I found an easier way to reproduce it:
- start skirmish
- select a soldier with at least 2 stackable items (eg. ammo)
- drop the first item to the floor
- drop the 2nd item to floor; it will stack
At this point the tooltip already says '3x ammo'.
Try to move the stack to a different place on the floor.
The tooltip display increases to '4x ammo'.
If you pick up the items again, the 'crash to geo' will sooner or later occur.
The invalid itemcount happens because I_AddToInventory() will be called *twice* in the drop process:
- first on the client where the drop occurs
- 2nd time when the event is executed.
So we have to eliminate one of the two calls. Don't know which one to prefer. Is there a general paradigm how such actions should be handled ?
====== tlh2000 (2010-02-16 18:11:35) ======
the client should ask the server to move the item - and the server should respond with an acc or a decline - so the one on the client should be removed. most of the inventory logic should be in the server (at least for the real actions) while we are in the battlescape. nice finding - i won't have the time to work on it in the next few days though. so feel free to fix it.
====== tlh2000 (2010-03-16 06:43:15) ======
should be fixed in r29015
====== sf-robot (2010-03-31 02:20:44) ======
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
====== tlh2000 (2010-05-10 05:24:41) ======
2010/05/09 21:47:39 ERROR: Game Error: Could not find item in inventory of ent 3 (type 2) at 6:0
I tried to pick up a plasma pistol ammo from a dead alien, and the server crashed with that error. Kicked me back to the geoscape.
====== tlh2000 (2010-07-05 15:18:28) ======
http://ufoai.ninex.info/forum/index.php?topic=5097.0
====== tlh2000 (2010-08-21 09:26:02) ======
is this nasty little critter still 'alive' after the inventory changes that were commited recently? (free inv list fix, change to linked list)
====== tlh2000 (2010-08-21 10:00:31) ======
this might already be fixed by the bugfix for ticket #3019816
====== sf-robot (2010-09-29 19:26:01) ======
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).