Heading "0" (zero) as a value ignored

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Heading "0" (zero) as a value ignored

Post by John Adams » Sun Apr 12, 2009 10:52 am

In some cases (doors specifically for this bug), setting an open_heading or close_heading to 0 (zero) degrees seems to make World think there is no value. Default for these fields appears to be -1, which according to SOE seems to be a valid heading on the compass (ie., open_heading of -20 is the same as an open_heading of 340).

For doors who's spawn heading is 90 and swing counter-clockwise, setting the open_heading to 0 results in the door not opening. Set the value to 1, or -1, the door opens properly. 1 degree is not a huge deal visually, but it adds excessive data entry we would otherwise not need to do if "0" were considered Zero Degrees.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: Heading "0" (zero) as a value ignored

Post by John Adams » Mon Aug 10, 2009 9:11 am

Devs,

I am trying to fix this issue where if a door's Heading = 0, the door won't open until you set the open_heading to something not "0" (zero).

Would this be the solution? Change:

Code: Select all

void Widget::OpenDoor(){
	if(GetOpenHeading() = 0)
		SetHeading(GetOpenHeading());
	if(GetOpenY() > 0){
To:

Code: Select all

void Widget::OpenDoor(){
	if(GetOpenHeading() >= 0)                           <-- added =
		SetHeading(GetOpenHeading());
	if(GetOpenY() > 0){
There is also another check in Widget::CloseDoor()

Code: Select all

void Widget::CloseDoor(){
	if(GetClosedHeading() >= 0)                           <-- added =
		SetHeading(GetClosedHeading());
	else if(GetOpenHeading() >= 0)                       <-- added =
		SetHeading(GetSpawnOrigHeading());
	if(GetCloseY() >= 0){
The reason I think Zero is valid is that by default, all these values are -1. I think they only get set to 0 if the DB has 0 as a value, which should be valid.

Going to test this on my server, but I am not sure of the long-term effects of OpenHeading = 0, so input would be appreciated.

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Heading "0" (zero) as a value ignored

Post by LethalEncounter » Wed Aug 12, 2009 2:48 pm

I don't see why it would have issues, but I haven't messed with that code in a while so who knows :P

Locked

Who is online

Users browsing this forum: No registered users and 0 guests