Page 1 of 1

Mountitem appears in playercorpse

Posted: Sat Sep 14, 2013 5:56 pm
by Kimungu
There is a bug on our shard for some time and it was not simple to reconstruct the circumstances:
  1. A player is riding an rideable (e.g. a horse) and dies.
    => The rideable stands in front of his corpse.
  2. He gets back to live and loots his corpse.
  3. Then he dies again.
    => Now there are two rideables in front of his corpse!
At 1. the mountitem appears in the corpse, thats the problem!
I've checked the mountitem, it is flagged newbie. That means usually, that it wouldn't be moved to the corpse.
I think the movement of the items from player to corpse is done by the core, am i right?

Re: Mountitem appears in playercorpse

Posted: Sat Sep 14, 2013 11:28 pm
by atreiu
chrdeath.src

Code: Select all

foreach it in EnumerateItemsInContainer(corpse)
	if (it.newbie)
	      MoveItemToContainer(it , ghost.backpack,0,0);
	endif
endforeach
but i think that reason in your mount scripts

Re: Mountitem appears in playercorpse

Posted: Sat Sep 14, 2013 11:45 pm
by Kimungu
I don't want to bypass the problem. I want to solve it.

In the backpack of the ghost, there is the mountitem too. Then the rideable gets created and his mountitem where destroyed.
But in the corpse, there is still a duplicate of the mountitem.

There are several ways to bypass this bug, but that solves not the problem.

Re: Mountitem appears in playercorpse

Posted: Sun Sep 15, 2013 1:27 am
by atreiu
you are clean coder) take from svn and fix it)

Re: Mountitem appears in playercorpse

Posted: Mon Sep 16, 2013 8:42 am
by Turley
Yep its somehow a bug introduced a year ago.

But to defend the coder, its not completely his fault. Why exactly do you ignore the moveable state in your loot function?

Re: Mountitem appears in playercorpse

Posted: Mon Sep 16, 2013 2:30 pm
by Tomi
This problem is now fixed with the last revision of core