Conversation
Co-authored-by: Rushaway <176180971+Rushaway@users.noreply.github.com>
The KeyValues parse buffer in LoadConfig was a single sBuffer_temp[32] shared by every string field, so "pt_spawner" was cut to 31 characters before being copied into Spawner[64] and item spawning then failed to match the point_template in the map. Size the parse buffer to the largest string field and introduce EW_MAX_SHORTNAME_LENGTH (32) / EW_MAX_TEMPLATE_LENGTH (64) so the shortname and point_template limits are declared in one place and used by the item structs, the parse buffer, sm_ewsetshortname and the point_template lookup. Suggested-by: notkoen Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
Opened against the wrong repository, reopening on srcdslab/sm-plugin-EntWatch. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suggested / co-authored by notkoen.
Problem
LoadConfig()reads every KeyValues string through one shared buffer:pt_spawneris copied intoclass_ItemConfig.Spawner[64], but it is readthrough that 32-byte buffer first, so any
point_templatename longer than31 characters is silently truncated.
EWM_Spawn_Spawn()then compares thetruncated name against
m_iNameof the map'spoint_templateentities,never finds a match, and
sm_espawnitemfails for those items.Change
entwatch/function.inc:EW_MAX_SHORTNAME_LENGTH= 32EW_MAX_TEMPLATE_LENGTH= 64sBuffer_tempis sized to the largest string field it has to hold(
EW_MAX_TEMPLATE_LENGTH), sopt_spawneris no longer cut short andshortnamegets its full 32 characters.in sync:
class_ItemConfig.ShortName/.Spawner,class_ItemList.ShortName,sm_ewsetshortname'ssNewName, andsPTNamein thepoint_templatelookup.No config format change and no behaviour change for names that already fit.
🤖 Generated with Claude Code