From 404ad8c72223bcadfbaf72f9dad82e194498d65d Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 17 Apr 2022 02:23:29 +0200 Subject: [PATCH] Score limit has been capped to 9 digits. Turns out anything higher is not actually reachable in practice. --- graphics/HUD/ScoreBox.png | Bin 0 -> 227 bytes graphics/HUD/ScoreBoxL.png | Bin 214 -> 0 bytes graphics/HUD/ScoreBoxM.png | Bin 97 -> 0 bytes graphics/HUD/ScoreBoxR.png | Bin 127 -> 0 bytes language.def_lore | 2 +- language.es_lore | 2 +- language.version | 4 +- lore/default/scoresystem.txt | 2 +- lore/es/scoresystem.txt | 2 +- zscript/handler/swwm_handler_cheats.zsc | 4 +- zscript/handler/swwm_handler_playerevents.zsc | 9 +- zscript/handler/swwm_handler_worldload.zsc | 2 +- zscript/hud/swwm_hud.zsc | 31 ++--- zscript/kbase/swwm_kbase.zsc | 8 +- zscript/kbase/swwm_kbasetab_stats.zsc | 3 +- zscript/kbase/swwm_kbasetab_store.zsc | 5 +- zscript/swwm_thinkers_player.zsc | 114 +++--------------- zscript/utility/swwm_utility.zsc | 26 +++- 18 files changed, 62 insertions(+), 152 deletions(-) create mode 100644 graphics/HUD/ScoreBox.png delete mode 100644 graphics/HUD/ScoreBoxL.png delete mode 100644 graphics/HUD/ScoreBoxM.png delete mode 100644 graphics/HUD/ScoreBoxR.png diff --git a/graphics/HUD/ScoreBox.png b/graphics/HUD/ScoreBox.png new file mode 100644 index 0000000000000000000000000000000000000000..3b9c89d1ae41b2d17a159e2a14856b632b71244b GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0y~yVDMsKU=UsQ8WaNsIPS1~WKvHG)zs9|6bf6qeuaOFmaVF-Qix{k zE|(UqxyI=ohTgL!u4k`}a_xznb!3L>iiI9NH?#$pdQHgsDDjAiWtm<@qagESAwdR) XRMh}>m5x98Ajf*T`njxgN@xNAgs4IT literal 0 HcmV?d00001 diff --git a/graphics/HUD/ScoreBoxL.png b/graphics/HUD/ScoreBoxL.png deleted file mode 100644 index 00839aed69d1cafd7ba5c22fcaa51f5c3fd8b678..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 214 zcmeAS@N?(olHy`uVBq!ia0y~yVBlw9U=US_6B-AJL?{8pWSirz=fPvvZ1H*p>hW`!>{}UMgH!%D?_Q{!nfq|(c$S;`T%o9iF z#S9D#!JaOTAsn*F8s5xJAGWZxxi~5m2#Yu*X=rL`Ho1Ng{i?`gt7^;P{PL12hx79@ zk}EpQLN;Do6&fJuyP{)3o6?mORSD+1>jcCV3`z?V5`vhRSsBj%lMdZ>&LjZjK2KLa Jmvv4FO#o5!J*WTx diff --git a/graphics/HUD/ScoreBoxM.png b/graphics/HUD/ScoreBoxM.png deleted file mode 100644 index 3b3f66d29e3a7c4623e1c71623ede256281aa821..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 97 zcmeAS@N?(olHy`uVBq!ia0y~yU|?flU=ZX0k^kiHW-~A_Xn49fhDcmaF7a6L|9k_h zfsuj1oP%lyk2Em%cnRnq)KFO1V0>ev7XyQ83afwou?_1O7#J8lUHx3vIVCg!0DcM^ An*aa+ diff --git a/graphics/HUD/ScoreBoxR.png b/graphics/HUD/ScoreBoxR.png deleted file mode 100644 index a8aa673a41a136eb2adcc769f33014d355f9b785..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 127 zcmeAS@N?(olHy`uVBq!ia0y~yU|?lnU=ZYBV_;wq)kw==U|?|bba4!kxSU+#vEu)E z23CGOnUsoxhYZTh%*=-+CB!BK{5XH$z=!#rjNB3@n|dxxNK8mbNci#bDf8ieeR&B9 hNePL6i&wKSIIIyqwrkNDX$A%c22WQ%mvv4FO#m}#CuINt diff --git a/language.def_lore b/language.def_lore index 6dc07187c..c230d4125 100644 --- a/language.def_lore +++ b/language.def_lore @@ -3239,7 +3239,7 @@ SWWM_LORETXT_SCORESYSTEM = "\n" "Carried items may also be refunded for additional points, allowing you to exchange them for anything else you'd prefer instead. This process is automated when obtaining weapons you already possess, or reach the carry limit for certain items.\n" "\n" -"Please do note that there is an imposed limit of 999,999,999,999,999,999 points, which, in practice, shouldn't even be remotely reachable.\n" +"Please do note that there is an imposed limit of 999999999 points, which, in practice, should take a very, very long time to reach.\n" "\n" "\cxSaya's Notes:\c-\n" "\cfAlright, I'll be honest here: This is more videogamey stuff from nerdboy. But I think it's good, in a way. There's something about the rush of seeing the numbers go up, you know, and you can get something nice out of it too. I can't exactly hide this from you but it's something we both agreed on, for your sake.\c-\n" diff --git a/language.es_lore b/language.es_lore index f3f62a168..630508346 100644 --- a/language.es_lore +++ b/language.es_lore @@ -2993,7 +2993,7 @@ SWWM_LORETXT_SCORESYSTEM = "\n" "Los ítems obtenidos pueden también reembolsarse por puntos adicionales, permitiendo intercambiarlos por cualquier otra cosa que prefieras en su lugar. El proceso es automatizado al obtener armas que ya tengas, o alcances el límite de carga de ciertos ítems.\n" "\n" -"Por favor ten en cuenta que hay un límite impuesto de 999.999.999.999.999.999 puntos, el cual, en la práctica, no debería ser posible alcanzar.\n" +"Por favor ten en cuenta que hay un límite impuesto de 999999999 puntos, el cual, en la práctica, tomaría mucho, mucho tiempo alcanzar.\n" "\n" "\cxNotas de Saya:\c-\n" "\cfVale, voy a ser sincera: Esto es otra cosa de videojuego del friki ese. Pero creo que es algo bueno, en cierto modo. Hay algo en esa sensación tan estimulante de ver los números crecer, sabes, y además puedes pillarte cosas bonitas con eso. A ver es que no puedo ocultártelo pero esto es algo en lo que coincidimos los dos, por tu bien.\c-\n" diff --git a/language.version b/language.version index 808efa25a..2db787e3a 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.10 r2 \cu(Sun 17 Apr 19:51:29 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.2.10 r2 \cu(2022-04-17 19:51:29)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.10 r3 \cu(Sun 17 Apr 19:51:50 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.2.10 r3 \cu(2022-04-17 19:51:50)\c-"; diff --git a/lore/default/scoresystem.txt b/lore/default/scoresystem.txt index c6095ec5d..20fb40038 100644 --- a/lore/default/scoresystem.txt +++ b/lore/default/scoresystem.txt @@ -18,7 +18,7 @@ Points are earned through the suppression of hostiles (relative to their threat Carried items may also be refunded for additional points, allowing you to exchange them for anything else you'd prefer instead. This process is automated when obtaining weapons you already possess, or reach the carry limit for certain items. -Please do note that there is an imposed limit of 999,999,999,999,999,999 points, which, in practice, shouldn't even be remotely reachable. +Please do note that there is an imposed limit of 999999999 points, which, in practice, should take a very, very long time to reach. \cxSaya's Notes:\c- \cfAlright, I'll be honest here: This is more videogamey stuff from nerdboy. But I think it's good, in a way. There's something about the rush of seeing the numbers go up, you know, and you can get something nice out of it too. I can't exactly hide this from you but it's something we both agreed on, for your sake.\c- diff --git a/lore/es/scoresystem.txt b/lore/es/scoresystem.txt index 57df586a0..4123d6439 100644 --- a/lore/es/scoresystem.txt +++ b/lore/es/scoresystem.txt @@ -14,7 +14,7 @@ Los puntos se consiguen por medio de la supresión de hostiles (relativos a su n Los ítems obtenidos pueden también reembolsarse por puntos adicionales, permitiendo intercambiarlos por cualquier otra cosa que prefieras en su lugar. El proceso es automatizado al obtener armas que ya tengas, o alcances el límite de carga de ciertos ítems. -Por favor ten en cuenta que hay un límite impuesto de 999.999.999.999.999.999 puntos, el cual, en la práctica, no debería ser posible alcanzar. +Por favor ten en cuenta que hay un límite impuesto de 999999999 puntos, el cual, en la práctica, tomaría mucho, mucho tiempo alcanzar. \cxNotas de Saya:\c- \cfVale, voy a ser sincera: Esto es otra cosa de videojuego del friki ese. Pero creo que es algo bueno, en cierto modo. Hay algo en esa sensación tan estimulante de ver los números crecer, sabes, y además puedes pillarte cosas bonitas con eso. A ver es que no puedo ocultártelo pero esto es algo en lo que coincidimos los dos, por tu bien.\c- diff --git a/zscript/handler/swwm_handler_cheats.zsc b/zscript/handler/swwm_handler_cheats.zsc index 1b885a069..556729054 100644 --- a/zscript/handler/swwm_handler_cheats.zsc +++ b/zscript/handler/swwm_handler_cheats.zsc @@ -28,8 +28,8 @@ extend Class SWWMHandler S_StartSound("menu/buyinv",CHAN_ITEM,CHANF_UI); S_StartSound("misc/emone",CHAN_VOICE,CHANF_UI); } - SWWMCredits.Give(players[e.Args[0]],0,1,true); - SWWMScoreObj.Spawn(1000000000,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2)); + SWWMCredits.Give(players[e.Args[0]],999999999); + SWWMScoreObj.Spawn(999999999,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2)); } else if ( e.Name ~== "swwmlorecheat" ) { diff --git a/zscript/handler/swwm_handler_playerevents.zsc b/zscript/handler/swwm_handler_playerevents.zsc index f6c1b59d3..9d658beae 100644 --- a/zscript/handler/swwm_handler_playerevents.zsc +++ b/zscript/handler/swwm_handler_playerevents.zsc @@ -41,13 +41,6 @@ extend Class SWWMHandler } } // create some static thinkers for this player if needed - SWWMTradeHistory th = SWWMTradeHistory.Find(p); - if ( !th ) - { - th = new("SWWMTradeHistory"); - th.ChangeStatNum(Thinker.STAT_STATIC); - th.myplayer = p; - } SWWMCredits c = SWWMCredits.Find(p); if ( !c ) { @@ -138,7 +131,7 @@ extend Class SWWMHandler SWWMCombatTracker.Spawn(players[e.playernumber].mo); // reset score (optional) if inventory should be cleared if ( swwm_resetscore && level.info.flags2&LEVEL2_RESETINVENTORY && !e.IsReturn ) - c.credits = c.hcredits = 0; + c.credits = 0; // re-add any missing collectibles after a death exit (yes, this happens) for ( int i=0; i= ScoreInter.mCurrentValue ) ScoreInter2.Update(s2); + ScoreInter.Update(SWWMCredits.Get(CPlayer)); } override void Tick() @@ -1215,9 +1212,7 @@ Class SWWMStatusBar : BaseStatusBar HealthTex[3] = TexMan.CheckForTexture("graphics/HUD/HealthBar3.png",TexMan.Type_Any); HealthTex[4] = TexMan.CheckForTexture("graphics/HUD/HealthBarS.png",TexMan.Type_Any); HealthTex[5] = TexMan.CheckForTexture("graphics/HUD/HealthBarD.png",TexMan.Type_Any); - ScoreTex[0] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxL.png",TexMan.Type_Any); - ScoreTex[1] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxM.png",TexMan.Type_Any); - ScoreTex[2] = TexMan.CheckForTexture("graphics/HUD/ScoreBoxR.png",TexMan.Type_Any); + ScoreTex = TexMan.CheckForTexture("graphics/HUD/ScoreBox.png",TexMan.Type_Any); WeaponTex = TexMan.CheckForTexture("graphics/HUD/WeaponBox.png",TexMan.Type_Any); ChatTex[0] = TexMan.CheckForTexture("graphics/HUD/ChatBoxTop.png",TexMan.Type_Any); ChatTex[1] = TexMan.CheckForTexture("graphics/HUD/ChatBoxLine.png",TexMan.Type_Any); @@ -1245,7 +1240,6 @@ Class SWWMStatusBar : BaseStatusBar minimapzoom = oldminimapzoom = 1.; HealthInter = DynamicValueInterpolator.Create(100,.1,1,100); ScoreInter = DynamicValueInterpolator.Create(0,.1,1,999999999); - ScoreInter2 = DynamicValueInterpolator.Create(0,.1,1,999999999); FuelInter = DynamicValueInterpolator.Create(120,.5,1,100); DashInter = DynamicValueInterpolator.Create(120,.5,1,40); hnd = SWWMHandler(EventHandler.Find("SWWMHandler")); @@ -2201,20 +2195,11 @@ Class SWWMStatusBar : BaseStatusBar private void DrawScore() { - String sstr; - if ( ScoreInter2.GetValue() > 0 ) sstr = String.Format("%d%09d",ScoreInter2.GetValue(),ScoreInter.GetValue()); - else sstr = String.Format("%09d",ScoreInter.GetValue()); - int digits = sstr.Length(); - int xx = 19+6*digits; - Screen.DrawTexture(ScoreTex[0],false,ss.x-(margin+xx),margin,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); + String sstr = String.Format("%09d",ScoreInter.GetValue()); + int xx = 73; + Screen.DrawTexture(ScoreTex,false,ss.x-(margin+xx),margin,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true); xx -= 15; - for ( int i=0; i 0 ) munstr.AppendFormat("%d",muns2); - munstr.AppendFormat("%09d",muns1); + muns = SWWMCredits.Get(players[consoleplayer]); + munstr = String.Format("\cg¥\c-%09d",muns); if ( (tabs.Size() <= 0) || (curtab == -1) || !tabs[curtab] ) return; tabs[curtab].Ticker(); } diff --git a/zscript/kbase/swwm_kbasetab_stats.zsc b/zscript/kbase/swwm_kbasetab_stats.zsc index 740ab2401..76fa32dcd 100644 --- a/zscript/kbase/swwm_kbasetab_stats.zsc +++ b/zscript/kbase/swwm_kbasetab_stats.zsc @@ -308,8 +308,7 @@ Class DemolitionistStatsTab : DemolitionistMenuTab str = str..def.GetTag(); } lists[0].items[29].label = str; - if ( stats.hhiscore > 0 ) str = String.Format("\cx%s\cu¥\c-%d%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hhiscore,stats.hiscore); - else str = String.Format("\cx%s\cu¥\c-%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hiscore); + str = String.Format("\cx%s\cu¥\c-%09d",StringTable.Localize("$SWWM_STATHISCORE"),stats.hiscore); lists[0].items[30].label = str; break; case 1: diff --git a/zscript/kbase/swwm_kbasetab_store.zsc b/zscript/kbase/swwm_kbasetab_store.zsc index 9b19bb3eb..e8c343a5e 100644 --- a/zscript/kbase/swwm_kbasetab_store.zsc +++ b/zscript/kbase/swwm_kbasetab_store.zsc @@ -548,15 +548,14 @@ Class DemolitionistMenuStoreItem : DemolitionistMenuListItem let def = GetDefaultByType(inv); if ( bSell ) { - pricelabel = String.Format("\cd¥%d\c-",price); + pricelabel = String.Format("\cd¥\c-",price); int cur = (inv is 'CandyGun')?(players[consoleplayer].mo.CountInv("CandyGunSpares")+1):players[consoleplayer].mo.CountInv(inv); if ( (cur > 1) || (inv is 'Ammo') ) label = String.Format("%s (%d/%d)",def.GetTag(),amt,cur); else label = def.GetTag(); } else { - if ( (price > master.muns1) && (master.muns2 <= 0) ) - pricelabel = String.Format("\cm¥%d\c-",price); + if ( price > master.muns ) pricelabel = String.Format("\cm¥%d\c-",price); else pricelabel = String.Format("\cx¥%d\cx",price); if ( (amt > 1) || (inv is 'Ammo') ) label = String.Format("%dx %s",amt,def.GetTag()); else label = def.GetTag(); diff --git a/zscript/swwm_thinkers_player.zsc b/zscript/swwm_thinkers_player.zsc index 15001efd4..7bfc3a8e4 100644 --- a/zscript/swwm_thinkers_player.zsc +++ b/zscript/swwm_thinkers_player.zsc @@ -112,7 +112,7 @@ Class SWWMStats : Thinker PlayerInfo myplayer; int lastspawn, dashcount, boostcount, stompcount, airtime, kills, deaths, damagedealt, hdamagedealt, damagetaken, hdamagetaken, - mkill, hiscore, hhiscore, topdealt, toptaken, skill, wponch, + mkill, hiscore, topdealt, toptaken, skill, wponch, busts, buttslams, secrets, items, parries, pparries, pats, befriend, smooch; double grounddist, airdist, swimdist, fuelusage, topspeed, teledist; @@ -292,44 +292,29 @@ Class SWWMStats : Thinker Class SWWMCredits : Thinker { PlayerInfo myplayer; - int credits, hcredits; + int credits; - static void Give( PlayerInfo p, int amount, int hamount = 0, bool cheat = false ) + static void Give( PlayerInfo p, int amount ) { let c = Find(p); if ( !c ) return; - if ( c.credits+amount < c.credits ) c.credits = int.max; - else c.credits += amount; - while ( c.credits > 999999999 ) - { - c.credits -= 1000000000; - c.hcredits++; - } - if ( (c.hcredits+hamount < c.hcredits) || (c.hcredits+hamount > 999999999) ) c.hcredits = 999999999; - else c.hcredits += hamount; + // safeguard + if ( amount < 0 ) ThrowAbortException("SWWMCredits.Give() called with negative amount"); + if ( c.credits+amount < c.credits ) c.credits = 999999999; + else c.credits = min(999999999,c.credits+amount); let s = SWWMStats.Find(p); - if ( s && ((c.hcredits > s.hhiscore) || ((c.credits > s.hiscore) && (c.hcredits >= s.hhiscore))) ) - { - s.hiscore = c.credits; - s.hhiscore = c.hcredits; - } + if ( s && (c.credits > s.hiscore) ) s.hiscore = c.credits; SWWMLoreLibrary.Add(p,"ScoreSystem"); } - static clearscope bool CanTake( PlayerInfo p, int amount, int hamount = 0 ) + static clearscope bool CanTake( PlayerInfo p, int amount ) { let c = Find(p); if ( !c ) return false; - int req = amount, hreq = hamount; - while ( req > 999999999 ) - { - req -= 1000000000; - hreq++; - } - // waaaaay too much - if ( (c.hcredits-hreq < 0) || (c.hcredits-hreq > c.hcredits) ) return false; + // safeguard + if ( amount < 0 ) ThrowAbortException("SWWMCredits.CanTake() called with negative amount"); // too much! - if ( ((c.credits-amount < 0) || (c.credits-amount > c.credits)) && (c.hcredits-hreq <= 0) ) return false; + if ( (amount > 999999999) || (c.credits-amount < 0) || (c.credits-amount > c.credits) ) return false; return true; } @@ -337,31 +322,19 @@ Class SWWMCredits : Thinker { let c = Find(p); if ( !c ) return false; - int req = amount, hreq = hamount; - while ( req > 999999999 ) - { - req -= 1000000000; - hreq++; - } - // waaaaay too much - if ( (c.hcredits-hreq < 0) || (c.hcredits-hreq > c.hcredits) ) return false; + // safeguard + if ( amount < 0 ) ThrowAbortException("SWWMCredits.Take() called with negative amount"); // too much! - if ( ((c.credits-amount < 0) || (c.credits-amount > c.credits)) && (c.hcredits-hreq <= 0) ) return false; - c.hcredits -= hreq; - c.credits -= req; - while ( c.credits < 0 ) - { - c.credits += 1000000000; - c.hcredits--; - } + if ( (amount > 999999999) || (c.credits-amount < 0) || (c.credits-amount > c.credits) ) return false; + c.credits -= amount; return true; } - static clearscope int, int Get( PlayerInfo p ) + static clearscope int Get( PlayerInfo p ) { let c = Find(p); if ( !c ) return 0; - return c.credits, c.hcredits; + return c.credits; } static clearscope SWWMCredits Find( PlayerInfo p ) @@ -377,57 +350,6 @@ Class SWWMCredits : Thinker } } -// Trading history between players -Class SWWMTrade -{ - int timestamp, type, amt; - String other; - Class what; -} - -Class SWWMTradeHistory : Thinker -{ - PlayerInfo myplayer; - Array ent; - - static void RegisterSend( PlayerInfo p, PlayerInfo other, Class what, int amt ) - { - let th = Find(p); - if ( !th ) return; - SWWMTrade t = new("SWWMTrade"); - t.timestamp = level.totaltime; - t.type = 0; - t.other = other.GetUserName(); - t.what = what; - t.amt = amt; - th.ent.Push(t); - } - static void RegisterReceive( PlayerInfo p, PlayerInfo other, Class what, int amt ) - { - let th = Find(p); - if ( !th ) return; - SWWMTrade t = new("SWWMTrade"); - t.timestamp = level.totaltime; - t.type = 1; - t.other = other.GetUserName(); - t.what = what; - t.amt = amt; - th.ent.Push(t); - } - - static clearscope SWWMTradeHistory Find( PlayerInfo p ) - { - let ti = ThinkerIterator.Create("SWWMTradeHistory",STAT_STATIC); - SWWMTradeHistory th; - while ( th = SWWMTradeHistory(ti.Next()) ) - { - if ( th.myplayer != p ) continue; - return th; - } - return Null; - } -} - // Lore holder enum ELoreTab { diff --git a/zscript/utility/swwm_utility.zsc b/zscript/utility/swwm_utility.zsc index 64d2efe6b..c68dd81b2 100644 --- a/zscript/utility/swwm_utility.zsc +++ b/zscript/utility/swwm_utility.zsc @@ -241,7 +241,7 @@ Class SWWMUtility } // not sure if I should use this, looks a bit ugly - static clearscope void ThousandsStr( out String s ) + static clearscope void ThousandsStr( out String s, int col = -1 ) { String nstr = s; s.Truncate(0); @@ -255,13 +255,27 @@ Class SWWMUtility s.AppendCharacter(ch); t = (t-1)%3; if ( (pos < len) && !t ) - s.AppendCharacter(0x2C); // comma + { + if ( col != -1 ) + { + s.AppendCharacter(0x1C); + s.AppendCharacter(0x61+col); + } + s.AppendCharacter(0x2C); + if ( col != -1 ) + { + s.AppendCharacter(0x1C); + s.AppendCharacter(0x2D); + } + } } } - static clearscope String ThousandsNum( int n ) + static clearscope String ThousandsNum( int n, int col = -1, int digits = 0 ) { - String nstr = String.Format("%d",n); - ThousandsStr(nstr); + String nstr; + if ( digits > 0 ) nstr = String.Format("%0*d",digits,n); + else nstr = String.Format("%d",n); + ThousandsStr(nstr,col); return nstr; } @@ -1889,7 +1903,7 @@ Class SWWMUtility PlayerInfo p = mo.player; if ( !p || !p.mo ) return; SWWMCredits c = SWWMCredits.Find(p); - if ( resetscore && c ) c.hcredits = c.credits = 0; + if ( resetscore && c ) c.credits = 0; Actor last = p.mo; while ( last.inv ) {