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

Add InvalidXMLException for spawn regions #948

Merged
merged 1 commit into from
Jan 8, 2022

Conversation

CoWinkKeyDinkInc
Copy link
Contributor

@CoWinkKeyDinkInc CoWinkKeyDinkInc commented Dec 24, 2021

This PR fixes a minor issue where PGM will load a map that uses improper XML that has been deprecated in 1.3.6.
When a user attempts to load the map, PGM will fail to load it because it can't find the spawn region for it. The map will eventually load (in correct regions) after trying to cycle to it again, but it's still quite fiddly of a process.

Invalid XML (for proto 1.4.0, valid below 1.3.6)

<spawns>
    <spawn id="red" team="red" kit="red" yaw="135">
        <region name="red-spawn"/>
    </spawn>
    <spawn id="blue" team="blue" kit="blue" yaw="-45">
        <region name="blue-spawn"/>
    </spawn>
    <default kit="obs" yaw="135">
        <point>-11.5,103,28.5</point>
    </default>
</spawns>

Valid XML

<spawns>
    <spawn team="blue" kit="blue-kit" yaw="-90">
        <regions>
            <point>-336.5,42,0.5</point>
        </regions>
    </spawn>
    <spawn team="red" kit="red-kit" yaw="90">
        <region>
            <point>0.5,42,0.5</point>
        </region>
    </spawn>
    <default yaw="180">
        <region>
            <point>-167.5,59,97.5</point>
        </region>
    </default>
</spawns>

The new convention is to define the spawn regions inside a <region>, <regions> or a region attribute in <spawn>.

Merry Christmas everyone :-)

@Electroid Electroid merged commit 87f2fa1 into PGMDev:dev Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants