Possible Bug Fix With Resting Zone In A Tavern Or Inn

I noticed that players entering a tavern/Inn then step out still had the ‘resting’ flag marked on them and will not go away unless they move a far distance from the zone (tavern/Inn).

I Found in [SIZE=10px]Player::UpdateZone(uint32 newZone, uint32 newArea) this:[/SIZE]

if (GetMapId() != GetInnPosMapId() || sqrt((GetPositionX()-GetInnPosX())*(GetPositionX()-GetInnPosX())+(GetPositionY()-GetInnPosY())*(GetPositionY()-GetInnPosY())+(GetPositionZ()-GetInnPosZ())*(GetPositionZ()-GetInnPosZ()))>40)

And Changed it to:

if (GetMapId() != GetInnPosMapId() || sqrt((GetPositionX()-GetInnPosX())*(GetPositionX()-GetInnPosX())+(GetPositionY()-GetInnPosY())*(GetPositionY()-GetInnPosY())+(GetPositionZ()-GetInnPosZ())*(GetPositionZ()-GetInnPosZ()))>1)

Was there a significant reason why the player had to be 40 yards/units away from Inn/Taverns?


I had viewed the areatriggers.dbc wiki already, my question is, why does the script say >40 away from the areatrigger box, it seems like a mistake why you would be 40 yards away from the trigger.

For example in areatrigger.dbc under ID 562, if you go to those XYZ coordinates it puts you in the middle of Lions Pride Inn in Goldshire and not at 1 of the corners of the Inn/Zone like I had assumed. So if the box size is 30 like the areatrigger shows, then why does this code say 40?

Thats like making the box (30+40) Once you step of ‘out’ the Inn (zone/trigger), it’s still triggered. Am I missing something?