Skip to content

Update world.h #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/src/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct mapstats
if(!e.attr2) e.attr2 = 255; /* needed for MAPVERSION<=2 */ \
if(e.attr1>32) e.attr1 = 32; /* 12_03 and below */ \
} \
if(headr.version<6 && strncmp(headr.head,"CUBE",4)==0) /* only render lights, pl starts and map models on old maps // <6 was <MAPVERSION but we're now at #7 (flowtron) */ \
if(strncmp(headr.head,"CUBE",4)==0) /* only render lights, pl starts and map models on old maps // <6 was <MAPVERSION but we're now at #7 (flowtron) */ \
Copy link
Member

@theonlypwner theonlypwner Apr 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If pCube maps have a version number of 6, wouldn't it make sense to change headr.version<6 to headr.version<7?

If that's done, then if(headr.version>=6 && headr.version<8) needs to be if(headr.version>=7 && headr.version<8)

{ \
switch(e.type) \
{ \
Expand Down Expand Up @@ -110,11 +110,14 @@ struct mapstats
case 14: /* old map model */ \
e.type=MAPMODEL; \
break; \
case 18: /* pcube ctf flag */ \
e.type=CTF_FLAG; \
break; \
default: \
e.type=NOTUSED; \
} \
} \
if(headr.version>=6 && headr.version<8) { \
if(strncmp(headr.head,"CUBE",4)==1 && (headr.version>=6 && headr.version<8)) { \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing the result of strncmp to 1 is unreliable.

if( e.type >= I_HELMET && e.type < (MAXENTTYPES - 1) ) { e.type += 1; } \
}

Expand Down