forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Corpses loaded from map dissapears

Open xmish opened this issue 2 years ago • 3 comments

Before creating an issue, please ensure:

  • [x] This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
  • [x] This issue is reproducible without changes to the C++ code in this repository

Steps to reproduce (include any configuration/script required to reproduce)

  1. Place a corpse on a map
  2. Start server
  3. After x seconds corpses decays

Expected behaviour

If items are loaded from map they don't expire or at least the one with AID do not expire. item->setLoadedFromMap() could be used:

bool Item::canDecay() const
{
	if (isRemoved() || isLoadedFromMap()) {
		return false;
	}

	if (getDecayTo() < 0 || getDecayTime() == 0) {
		return false;
	}

	if (hasAttribute(ITEM_ATTRIBUTE_UNIQUEID)) {
		return false;
	}

	return true;
}

Or maybe it's intended and there's other way of doing it, like special corpse item that do not decay etc.

Actual behaviour

Items decay no matter what (expect onces with UID)

Environment

Reproduction environment

xmish avatar Feb 12 '23 14:02 xmish

I believe they shouldn't decay until moved/interacted with.

soul4soul avatar Feb 12 '23 16:02 soul4soul

it has been years since cip uses different corpses ids for different purposes, we mainly have two types:

the ones that decay and the ones that don't, we use the latter to place on map as "decoration" or quest container

EPuncker avatar Feb 15 '23 09:02 EPuncker

it has been years since cip uses different corpses ids for different purposes, we mainly have two types:

the ones that decay and the ones that don't, we use the latter to place on map as "decoration" or quest container

That's a thing they do too, but check frodo's shop there is a burning candle that spawns on server save. It will burn all day until moved, onces it moved it will burn out in 20minutes

soul4soul avatar Feb 16 '23 14:02 soul4soul