fix(FieldManager): handle FieldToHome portal migration correctly - #539
Conversation
WalkthroughA new case for the Changes
Sequence Diagram(s)sequenceDiagram
participant Player
participant FieldManager
participant Session
Player->>FieldManager: UsePortal(portal)
FieldManager->>FieldManager: switch(portal.Type)
alt PortalType.FieldToHome
FieldManager->>Session: MigrateToMap(Constant.DefaultHomeMapId, portal.HomeId)
else Other portal types
FieldManager->>Session: Existing portal handling logic
end
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 0
🧹 Nitpick comments (1)
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs (1)
553-555: LGTM! Clean implementation of FieldToHome portal handling.The new case correctly handles
PortalType.FieldToHomeby migrating the player to the default home map using the portal'sHomeIdas the owner identifier. The implementation follows the established pattern of other portal types in the switch statement.Consider adding validation for
fieldPortal.HomeIdto ensure it's a valid home identifier:case PortalType.FieldToHome: + if (fieldPortal.HomeId <= 0) { + session.Send(FieldEnterPacket.Error(MigrationError.s_move_err_default)); + return false; + } session.Migrate(Constant.DefaultHomeMapId, fieldPortal.HomeId); break;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
Maple2.Server.Game/Manager/Field/FieldManager/FieldManager.cs (2)
Maple2.Server.Game/Session/GameSession.cs (1)
Migrate(674-706)Maple2.Model/Metadata/Constants.cs (1)
Constant(10-960)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build
- GitHub Check: build
- GitHub Check: format
Summary by CodeRabbit