READY: this PR is (to the best of your knowledge) ready to be incorporated into the game.
Description
[fixed] Some components and devices had the wrong frame after rejoining server
[dev] canBePickedUp() removed from component scripts and added to GenericComponent.as
[dev] this.Tag("builder always hit") removed from component scripts and added to GenericComponent.as
[dev] getNet().isServer() changed to isServer()
[dev] getNet().isClient() changed to isClient()
[changed] Spike and GenericSpike merged, Spike won't have a blood spritelayer but instead changes its frame (similar to https://github.com/transhumandesign/kag-base/pull/1854 )
This PR changes code in components to make their sprite frame update on rejoining the server.
Some code moved from component scripts to GenericComponent.as as a clean-up measure. If there should be any component in the future that needs to be picked up or not be hit by builder, it can all be changed, but for now I think it is better to not repeat canBePickedUp() and this.Tag("builder always hit") a quadrillion times.
However, I didn't seek a solution for the repeated onReceiveCreateData() and UpdateSprite() instances because I didn't want to add a new script and add it to all the component blobs.
Anyway, this PR has more deletions than additions. :)
Please note, this PR - similarly to https://github.com/transhumandesign/kag-base/pull/1854 - merges Spike.as and GenericSpike.as. The linked PR implements that spike from spiker properly remembers its bloody state but at the time of this writing, it still has an issue that spike will be displayed on top of the spiker frame on rejoining. This PR fixes that.
Tested in online and offline, no problems encountered.
Steps to Test or Reproduce
Join server.
Place a bunch of components and devices such as lamp, toggle, lever, spiker and pressure plate.
Have them in different states (active and inactive), then quit and rejoin server.
Notice they will have the wrong sprite frame (usually inactive, when it should have the active sprite etc.).
After this PR, all components and devices will have the correct sprite frame after rejoining.
Status
Description
[fixed] Some components and devices had the wrong frame after rejoining server [dev] canBePickedUp() removed from component scripts and added to GenericComponent.as [dev] this.Tag("builder always hit") removed from component scripts and added to GenericComponent.as [dev] getNet().isServer() changed to isServer() [dev] getNet().isClient() changed to isClient() [changed] Spike and GenericSpike merged, Spike won't have a blood spritelayer but instead changes its frame (similar to https://github.com/transhumandesign/kag-base/pull/1854 )
Fixes https://github.com/transhumandesign/kag-base/issues/2004
This PR changes code in components to make their sprite frame update on rejoining the server.
Some code moved from component scripts to
GenericComponent.as
as a clean-up measure. If there should be any component in the future that needs to be picked up or not be hit by builder, it can all be changed, but for now I think it is better to not repeatcanBePickedUp()
andthis.Tag("builder always hit")
a quadrillion times. However, I didn't seek a solution for the repeatedonReceiveCreateData()
andUpdateSprite()
instances because I didn't want to add a new script and add it to all the component blobs. Anyway, this PR has more deletions than additions. :)Please note, this PR - similarly to https://github.com/transhumandesign/kag-base/pull/1854 - merges
Spike.as
andGenericSpike.as
. The linked PR implements that spike from spiker properly remembers its bloody state but at the time of this writing, it still has an issue that spike will be displayed on top of the spiker frame on rejoining. This PR fixes that.Tested in online and offline, no problems encountered.
Steps to Test or Reproduce
Join server. Place a bunch of components and devices such as lamp, toggle, lever, spiker and pressure plate. Have them in different states (active and inactive), then quit and rejoin server. Notice they will have the wrong sprite frame (usually inactive, when it should have the active sprite etc.). After this PR, all components and devices will have the correct sprite frame after rejoining.