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

Partial MapManager refactor #5042

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

ElectroJr
Copy link
Member

@ElectroJr ElectroJr commented Apr 16, 2024

This PR partially refactors map manager and moves a lot of the logic into the map system. Half of the changes are just updates to unit tests to avoid obsolete warnings and to get rid of explicit map Ids.

IMO all the map code should eventually be moved to the system as I don't know of any reason not to, its nice being able to use all the entity system convenience methods, and having the functionality split between a manager & system is just kind of awkward.

Requires space-wizards/space-station-14/pull/26994

Changes:

  • Moves map creation, pausing and initialization logic from IMapManager to MapSystem
    • Various IMapManager methods are now marked as obsolete, and just redirect to the system.
    • The new map creation methods can return both the MapId and EntityUid.
  • Removes
    • IMapManagerInternal.CreateMap()
    • IMapManager.RemoveMapId()
    • IMapManager.NextMapId()
    • IMapManager.GetGridComp()
    • IMapManager.GetAllGrids()
  • Adds a new IEntityManager.InitializeAndStartEntity override that allows you to specify whether the entity should get map-initialized
    • Previously this was always automatically inferred from the current MapId.
    • Used to fix a bug introduced in Modify container/spawn helper methods #5030, where spawning an entity into a container on a pre-init map would map-initialize the spawned entity.
  • Adds "client-side" mapIds.
    • These are just MapIds with negative values.
    • Required to ensure that a client-side map entity doesn't get assigned a MapId that ends up conflicting with a server-side map.
    • I don't know if a game will ever actually need this functionality, but it was pretty trivial to add.

@ElectroJr ElectroJr added the Status: Requires Content PR This PR breaks content and requires both to be merged together. label Apr 16, 2024
@metalgearsloth
Copy link
Contributor

Lord forgive me for conflicts but I need this so fucking bad.

@metalgearsloth metalgearsloth merged commit d5c4981 into space-wizards:master Apr 18, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Requires Content PR This PR breaks content and requires both to be merged together.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants