Skip to content

Commit

Permalink
change playerless sentinel check to check for a player and not just a…
Browse files Browse the repository at this point in the history
…n entity
  • Loading branch information
SamsTheNerd committed Nov 5, 2024
1 parent 92b668f commit eafa509
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OpCreateSentinel(val extendsRange: Boolean) : SpellAction {
args: List<Iota>,
env: CastingEnvironment
): SpellAction.Result {
if (env.castingEntity == null)
if (env.castingEntity !is ServerPlayer)
throw MishapBadCaster()

val target = args.getVec3(0, argc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object OpDestroySentinel : SpellAction {
args: List<Iota>,
env: CastingEnvironment
): SpellAction.Result {
if (env.castingEntity == null)
if (env.castingEntity !is ServerPlayer)
throw MishapBadCaster()

val sentinel = IXplatAbstractions.INSTANCE.getSentinel(env.castingEntity as? ServerPlayer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object OpGetSentinelPos : ConstMediaAction {
override val argc = 0
override val mediaCost: Long = MediaConstants.DUST_UNIT / 10
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
if (env.castingEntity == null)
if (env.castingEntity !is ServerPlayer)
throw MishapBadCaster()

val sentinel = IXplatAbstractions.INSTANCE.getSentinel(env.castingEntity as? ServerPlayer) ?: return listOf(NullIota())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ object OpGetSentinelWayfind : ConstMediaAction {
override val argc = 1
override val mediaCost: Long = MediaConstants.DUST_UNIT / 10
override fun execute(args: List<Iota>, env: CastingEnvironment): List<Iota> {
if (env.castingEntity == null)
if (env.castingEntity !is ServerPlayer)
throw MishapBadCaster()

val from = args.getVec3(0, argc)
Expand Down

0 comments on commit eafa509

Please sign in to comment.