Mountitem appears in playercorpse

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.

Moderators: POL Developer, Distro Developer

Locked
Kimungu
New User
Posts: 6
Joined: Tue Jan 22, 2013 7:54 am

Mountitem appears in playercorpse

Post 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?
User avatar
atreiu
Grandmaster Poster
Posts: 151
Joined: Mon May 24, 2010 1:08 pm
Location: Russia, Moscow

Re: Mountitem appears in playercorpse

Post 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
Kimungu
New User
Posts: 6
Joined: Tue Jan 22, 2013 7:54 am

Re: Mountitem appears in playercorpse

Post 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.
User avatar
atreiu
Grandmaster Poster
Posts: 151
Joined: Mon May 24, 2010 1:08 pm
Location: Russia, Moscow

Re: Mountitem appears in playercorpse

Post by atreiu »

you are clean coder) take from svn and fix it)
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Mountitem appears in playercorpse

Post 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?
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Mountitem appears in playercorpse

Post by Tomi »

This problem is now fixed with the last revision of core
Locked