fix: Weird stuff in draw_management_unit#503
Conversation
📝 WalkthroughWalkthroughPraise the Omnissiah, the machine spirit has been recalibrated. The modifications in the first module update the logic to retrieve weapon data from a unit. Two lines of code now store the first and second weapon details in an array. When the data structure for each weapon is verified, a tooltip description is generated for display. In the second module, the directive comparing weapon values has been corrected: the condition now appropriately checks the second weapon rather than mistakenly re-evaluating the first. These changes ensure that the unit's armament details are properly processed and presented, aligning each function with the intended data stream. No alterations were made to the public or exported declarations. Suggested labels
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
objects/obj_controller/Step_0.gml(1 hunks)scripts/scr_draw_management_unit/scr_draw_management_unit.gml(1 hunks)
🔇 Additional comments (1)
objects/obj_controller/Step_0.gml (1)
307-318: By the Omnissiah's grace, the weapon data retrieval logic has been optimized.The machine spirit now correctly stores and processes both primary and secondary weapon data structures, generating appropriate tooltip descriptions for each armament.
Praise be to the Machine God, for this implementation follows the sacred patterns:
- Proper null-checking through
is_struct()validation- Consistent error handling with empty string fallbacks
- Clear separation between weapon data retrieval and tooltip generation
Purpose of the PR
Fix issues that the bot picked up in another PR and the ones that I've found along the way.

Describe the solution
Fix typo that was comparing weapon one to both temp values.
Assign weapon structs to temp values, as for some reason they were skipped.
Testing done
Launched the game and checked the management screen - no issues.
But I'm also not sure what was this typo causing in the first place and what exactly that code does.
Related links
#500 (review)