Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughBoth game engine variants add a debug diagnostic during weapon template post-processing. It logs when a projectile’s major geometry radius exceeds the primary damage radius of a weapon with positive primary damage. ChangesProjectile radius diagnostic
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change adds debug diagnostics in both game variants, with no supported gameplay regression. No actionable merge-blocking risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
| m_projectileTmpl = TheThingFactory->findTemplate(m_projectileName); | ||
| DEBUG_ASSERTCRASH(m_projectileTmpl, ("projectile %s not found!",m_projectileName.str())); | ||
|
|
||
| #if RTS_DEBUG |
There was a problem hiding this comment.
postProcessLoad (xfer saveload) is not the right place for it. It needs to go into a validate function after INI parse (WeaponStore::parseWeaponTemplateDefinition).
There was a problem hiding this comment.
That's where I originally put it, but m_projectileTmpl is null here.
There was a problem hiding this comment.
Yes that is unfortunate. There currently is no standardized way of calling validate after INI parsing, but in this case it would need to be called at the end of all INI parse then. Maybe we should add a interface for INI classes, similar to SubsystemInterface.
There was a problem hiding this comment.
That's effectively what postProcessLoad does though? It runs after all INI data has been parsed so that any references/data can be assigned/validated.
There was a problem hiding this comment.
Ohh you are right. I was not aware. Maybe we need to consolidate the validate functions and postProcessLoad. I will take a look.
| if (m_projectileTmpl && m_primaryDamage > 0.0) | ||
| { | ||
| const Real projectileRadius = m_projectileTmpl->getTemplateGeometryInfo().getMajorRadius(); | ||
| if (m_primaryDamageRadius < projectileRadius) |
There was a problem hiding this comment.
While at it, maybe also add a log for when secondary radius is smaller equal primary radius.
This change adds logging for detecting erroneous weapon radii. This applies to cases where a weapon template's
PrimaryDamageRadiusis smaller than its projectile object'sGeometryMajorRadius, which can result in inconsistent damage being applied to targets.See TheSuperHackers/GeneralsGamePatch2#193 for more info.