I think the function "LoadPlayerCorpses" is run when a zone is loaded up. If we put a function to check if the corpses have rotted,
it should resolve the issue. Keep in mind this is depends on real time and not game time...
If the server is off for 2 days, it does not move the rot time.....
In PlayerCorpse.cpp find
Code:
bool ZoneDatabase::LoadPlayerCorpses(int32 iZoneID) {
Under the line
Code:
unsigned long* lengths;
#####WARNING UNTESTED CODE#####
Warning, I took a look at this, but have not actually run the code. BACKUP the table, player_corpses BEFORE USING.....
Add this
Code:
if(!RuleB(Zone, EnableShadowrest))
{
RunQuery(query, MakeAnyLenString(&query, "update player_corpses set IsBurried=1 where zoneid= %u and (UNIX_TIMESTAMP(timeofdeath) + %u) < UNIX_TIMESTAMP(NOW()) ", iZoneID, RuleI(Character, CorpseDecayTimeMS)), errbuf);
}
else
{
RunQuery(query, MakeAnyLenString(&query, "delete from player_corpses where zoneid= %u and (UNIX_TIMESTAMP(timeofdeath) + %u) < UNIX_TIMESTAMP(NOW()) ", iZoneID, RuleI(Character, CorpseDecayTimeMS)), errbuf);
}
safe_delete_array(query);
####WARNING UNTESTED CODE#####
Warning, I took a look at this, but have not actually run the code. BACKUP the table, player_corpses BEFORE USING.....