You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
StructureSpawnwas something added later in the game, it was originally Spawn (that's why both are supported in the game). I kept it as Spawn for backward compatibility, but didn't realize alias type won't allow instanceof.
I've changed StructureSpawn to extends Spawn with no other change. It should fix the instanceof problem but let me know if it causes anything else
Currently TypeScript rejects this if condition:
s instanceof StructureSpawn
since StructureSpawn is defined as a type, not a class. However, this works:
s instanceof Spawn
This is somewhat annoying, since the two do seem to be interchangeable. The docs, for what it's worth, specifically refer to the class/prototype as "StructureSpawn" (not "Spawn"): http://support.screeps.com/hc/en-us/articles/205990342-StructureSpawn
The text was updated successfully, but these errors were encountered: