-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
id24: implement DEHACKED "Carousel icon" weapon block field (#2144)
- Loading branch information
Showing
3 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1503,6 +1503,8 @@ char *deh_weapon[] = | |
// mbf21 | ||
"Ammo per shot", // .ammopershot | ||
"MBF21 Bits", // .flags | ||
// id24 | ||
"Carousel icon", // .carouselicon | ||
}; | ||
|
||
// CHEATS - Dehacked block name = "Cheat" | ||
|
@@ -2566,7 +2568,20 @@ void deh_procWeapon(DEHFILE *fpin, FILE* fpout, char *line) | |
|
||
weaponinfo[indexnum].flags = value; | ||
} | ||
else | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rfomin
Author
Collaborator
|
||
else | ||
if (!strcasecmp(key, deh_weapon[8])) // Carousel icon | ||
{ | ||
char candidate[9] = {0}; | ||
M_CopyLumpName(candidate, ptr_lstrip(strval)); | ||
int len = strlen(candidate); | ||
if (len < 1 || len > 7) | ||
{ | ||
if (fpout) fprintf(fpout,"Bad length for carousel icon name '%s'\n",candidate); | ||
continue; | ||
} | ||
weaponinfo[indexnum].carouselicon = M_StringDuplicate(candidate); | ||
} | ||
else | ||
if (fpout) fprintf(fpout,"Invalid weapon string index for '%s'\n",key); | ||
} | ||
return; | ||
|
@@ -3397,7 +3412,7 @@ void rstrip(char *s) // strip trailing whitespace | |
// | ||
char *ptr_lstrip(char *p) // point past leading whitespace | ||
{ | ||
while (*p >= 0 && isspace(*p)) | ||
while (*p && isspace(*p)) | ||
p++; | ||
return p; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should we re-indent (this part of)
src/d_deh.c
with our clang-format rules? Its layout has really become close to unreadable.