Skip to content
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

Merged
merged 21 commits into from
Sep 20, 2024
Merged

Removed instances_count #3464

merged 21 commits into from
Sep 20, 2024

Conversation

benlp91
Copy link
Contributor

@benlp91 benlp91 commented Sep 15, 2024

No description provided.

@@ -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];
Copy link
Member

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

@@ -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);
Copy link
Member

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

/** 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];
Copy link
Member

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

@@ -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];
Copy link
Member

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

@Loobinex Loobinex marked this pull request as draft September 16, 2024 14:47
// 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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this indent correct?

@Loobinex Loobinex changed the title Rough template to remove instances_count Removed instances_count Sep 16, 2024
@Loobinex Loobinex marked this pull request as ready for review September 16, 2024 21:40
@Loobinex Loobinex merged commit 5f25463 into master Sep 20, 2024
@Loobinex Loobinex deleted the removed-instance-count branch September 20, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants