From 99c9bda6ea498ce4cec1c0dbc11177f710a9f1f5 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Sat, 11 Feb 2023 13:19:03 +0100 Subject: [PATCH] Fix implicit class pointer casting. --- language.version | 4 ++-- zscript/handler/swwm_statichandler.zsc | 2 +- zscript/player/swwm_player_inventory.zsc | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/language.version b/language.version index 5c3dc3e8d..4edb5d0d7 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r743 \cu(Sat 11 Feb 13:27:05 CET 2023)\c-"; -SWWM_SHORTVER="\cw1.3pre r743 \cu(2023-02-11 13:27:05)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r744 \cu(Sat 11 Feb 13:27:17 CET 2023)\c-"; +SWWM_SHORTVER="\cw1.3pre r744 \cu(2023-02-11 13:27:17)\c-"; diff --git a/zscript/handler/swwm_statichandler.zsc b/zscript/handler/swwm_statichandler.zsc index 3c6de6058..6dac620b9 100644 --- a/zscript/handler/swwm_statichandler.zsc +++ b/zscript/handler/swwm_statichandler.zsc @@ -335,7 +335,7 @@ Class SWWMStaticHandler : StaticEventHandler { if ( !(cls is 'Thinker') || (cls is 'Actor') || (cls == 'Thinker') ) continue; - sdefs.Push(cls); + sdefs.Push((Class)(cls)); } if ( !e.Args[0] ) { diff --git a/zscript/player/swwm_player_inventory.zsc b/zscript/player/swwm_player_inventory.zsc index 019ee73ce..aa5e3e0cb 100644 --- a/zscript/player/swwm_player_inventory.zsc +++ b/zscript/player/swwm_player_inventory.zsc @@ -124,13 +124,14 @@ extend Class Demolitionist // add collectible to stats if ( item is 'SWWMCollectible' ) { + let col = SWWMCollectible(item); if ( !ingivecheat ) { - SWWMHandler.AddOneliner(SWWMCollectible(item).GetLine,2); + SWWMHandler.AddOneliner(col.GetLine,2); facegrin = true; } if ( !mystats ) return; - let cls = item.GetClass(); + let cls = col.GetClass(); if ( (mystats.ownedcollectibles.Size() > 0) && (mystats.ownedcollectibles.Find(cls) < mystats.ownedcollectibles.Size()) ) return; mystats.ownedcollectibles.Push(cls); }