PGM icon indicating copy to clipboard operation
PGM copied to clipboard

<clear> within child kit clears spawn kits

Open CrazyisCreeps opened this issue 6 years ago • 13 comments

Not sure if the title makes any sense so feel free to adjust it.

One of the issues we've been running into when converting maps on Stratus is that certain maps have spawn kits that look like this.

Capture

The within the child kit ends up clearing items from the spawn kit for players, meaning players haven't been spawning with items. This wasn't an issue in the other version of PGM stratus used to run, and although it's an easy enough fix to do in the xml file itself, I figured I'd raise attention to it.

CrazyisCreeps avatar Nov 03 '19 19:11 CrazyisCreeps

Is the issue that <clear-items/> clears all the items in the child and parent kit? Or that it doesn't?

Electroid avatar Nov 03 '19 20:11 Electroid

The issue we were having was that <clear-items/> clears the parent, so only the child kits were received

CrazyisCreeps avatar Nov 03 '19 20:11 CrazyisCreeps

But isn't that what it should do? <clear-items/> will clear all the items?

Electroid avatar Nov 05 '19 17:11 Electroid

Yea ^ kit "parents" are simply added to the kit, and no layering is actually respected. <clear-items> does what it is intended to do, clear all items. An optional attribute could be added to only clear based on kit context, but the base issue described here is not a bug.

AustinLMayes avatar Nov 05 '19 18:11 AustinLMayes

Mhm the behaviour makes perfect sense, however in the previous of PGM that was open sourced, it didn't happen like this.

CrazyisCreeps avatar Nov 05 '19 19:11 CrazyisCreeps

Clear should be the first thing applied if the kit (or parents) has it, then it should give all items. At least that's what the docs say: You can also clear the player’s entire inventory before applying the kit by using one of the elements below.

Pablete1234 avatar Nov 05 '19 19:11 Pablete1234

So, this doesn't seem like a bug?

Electroid avatar Nov 05 '19 21:11 Electroid

It seems like a bug that pgm should clear first, then apply kits. In this pgm it's first applying parent kit, then clearing parent and applying child kit

Pablete1234 avatar Nov 05 '19 21:11 Pablete1234

In this pgm it's first applying parent kit, then clearing parent and applying child kit

But it's that what it should do? Kits are applied in-order.

Electroid avatar Nov 07 '19 16:11 Electroid

Is this really a bug? It seems to be more of a problem with the map than with PGM. The child kit is applied after the spawn kit, so any items given by the spawn kit will be cleared by the <clear-items/>.

https://github.com/Electroid/PGM/blob/bf8945b3985e98f117b17a314bbb5dada04ab4d6/src/main/java/tc/oc/pgm/kits/KitParser.java#L101

Meeples10 avatar Jan 24 '20 19:01 Meeples10

@Meeples10 i am pretty sure, it is a pgm bug. In newer pgm versions, it was made so pgm would always apply the clear kit before anything. The current behaviour is:

  • Parent clear
  • Parent give items
  • Child clear
  • Child give items

1.9 PGM behaviour was:

  • Parent clear
  • Child clear
  • Parent give items
  • Child give items

Pablete1234 avatar Jan 24 '20 20:01 Pablete1234

@Electroid Would like a ruling here on whether the behaviour should get updated to match 1.9 PGM.

rafibaum avatar May 07 '20 20:05 rafibaum

Well IMO it just doesn't make any sense otherwise @rafibaum . With current behaviour all it does is make a certain XML configuration stupid (having a parent & a clear, makes one invalidate the other), while having it like 1.9+ PGM makes it so you can make use of parent kit with a clear for previous items

Pablete1234 avatar May 07 '20 21:05 Pablete1234