Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #12  
Old 11-22-2002, 06:53 AM
alkrun
Sarnak
 
Join Date: Jan 2002
Posts: 66
Default

for(uint32 i=0; i <= max_door_type; i++)
{
Door* door = GetDoorDBID(i);
if(door == NULL)
continue;

if(door->db_id == 0 || strcasecmp(door->zone_name, zone_name))
continue;

if(door->door_id == door_id && strcasecmp(door->zone_name, zone_name) == 0)
return door;
}



My personal preference... I hate using 0 in the place of NULL. it's one of my biggest complaints about the emu sourcecode. Since you all don't use hungarian, sometimes it's not directly obvious if a variable is an id or a pointer. If you see this:

if(door == 0)

door could be either. If you see this:

if(door = NULL)

then it's pretty obvious that it's a pointer.

Another of my pointer issues is testing for null in the same conditional as you use to test for a member's value like the original code was testing door and then the door's database id. I prefer to see them split up like I have them. Again, it's a style thing, but with so many people working on the same code, it's easy to get someone to add a condition to your statement and make a mistake.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:20 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3