-
Notifications
You must be signed in to change notification settings - Fork 77
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
Removed instances_count #3464
Removed instances_count #3464
Conversation
src/creature_control.h
Outdated
@@ -348,7 +348,7 @@ unsigned char sound_flag; | |||
MapSubtlCoord targtstl_x; | |||
MapSubtlCoord targtstl_y; | |||
unsigned long instance_use_turn[INSTANCE_TYPES_MAX]; | |||
char instance_available[INSTANCE_TYPES_MAX]; | |||
short instance_available[INSTANCE_TYPES_MAX]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this simply stores a yes or no INSTANCE_TYPES_MAXs times, the size of the yes or no can remain small, a TbBool makes more sense then a char though
src/config_creature.c
Outdated
@@ -1645,14 +1636,6 @@ TbBool load_creaturetypes_config_file(const char *textname, const char *fname, u | |||
WARNMSG("Parsing %s file \"%s\" experience block failed.",textname,fname); | |||
} | |||
if (result) | |||
{ | |||
result = parse_creaturetype_instance_blocks(buf, len, textname, flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like the reading of the block itself, so if you remove it it won't load the instances at all
src/creature_control.h
Outdated
/** Required level to use the instances creature can learn. Scaled 1..CREATURE_MAX_LEVEL. */ | ||
unsigned char learned_instance_level[LEARNED_INSTANCES_COUNT]; | ||
unsigned short learned_instance_level[LEARNED_INSTANCES_COUNT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one just stores a level so 0-9 no need for it to be a short
src/creature_control.h
Outdated
@@ -464,9 +464,9 @@ struct CreatureStats { // These stats are not compatible with original DK - they | |||
unsigned char attack_preference; | |||
short field_of_view; | |||
/** Instance identifiers of the instances creature can learn. */ | |||
unsigned char learned_instance_id[LEARNED_INSTANCES_COUNT]; | |||
short learned_instance_id[LEARNED_INSTANCES_COUNT]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as for instance_id instance_available and active_instance_id those 3 could use type CrInstance
src/config_creature.c
Outdated
// Loading file data | ||
len = LbFileLoadAt(fname, buf); | ||
TbBool result = (len > 0); | ||
// Parse blocks of the config file | ||
if (result) | ||
{ | ||
result = parse_creaturetypes_common_blocks(buf, len, textname, flags); | ||
result = parse_creaturetypes_common_blocks(buf, len, textname, flags); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this indent correct?
No description provided.