Fix swapped weapons having bDROPPED.

This commit is contained in:
Mari the Deer 2022-08-12 01:24:51 +02:00
commit 823da0615e
3 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r304 \cu(Fri 12 Aug 00:08:51 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r304 \cu(2022-08-12 00:08:51)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r305 \cu(Fri 12 Aug 01:24:51 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r305 \cu(2022-08-12 01:24:51)\c-";

View file

@ -96,7 +96,7 @@ extend Class SWWMHandler
Vector2 vpos = SWWMUtility.NDCToViewport(projdata,ndc);
String tag = a.player?a.player.GetUserName():a.GetTag();
if ( tag == a.GetClassName() ) SWWMUtility.BeautifyClassName(tag);
Screen.DrawText(NewSmallFont,Font.CR_RED,vpos.x-NewSmallFont.StringWidth(tag)/2,vpos.y-NewSmallFont.GetHeight()/2,tag);
Screen.DrawText(NewSmallFont,a.bDROPPED?Font.CR_DARKRED:Font.CR_RED,vpos.x-NewSmallFont.StringWidth(tag)/2,vpos.y-NewSmallFont.GetHeight()/2,tag);
}
private ui void DrawDebug( RenderEvent e )

View file

@ -114,6 +114,7 @@ Class SWWMWeapon : Weapon abstract
{
// create a dual giver
let dg = SWWMDualWeaponGiver(Spawn("SWWMDualWeaponGiver",pos));
dg.bDROPPED = false;
dg.angle = angle;
dg.vel = vel;
dg.FloatBobPhase = FloatBobPhase;
@ -128,6 +129,7 @@ Class SWWMWeapon : Weapon abstract
{
// swap in-place
let d = user.DropInventory(sw);
d.bDROPPED = false;
d.SetOrigin(pos,false);
d.angle = angle;
d.vel = vel;
@ -707,6 +709,7 @@ Class SWWMDualWeaponGiver : Inventory
if ( !giveme[1].CallTryPickup(toucher) ) giveme[1].Destroy();
// drop the other where we stand
giveme[0].BecomePickup();
giveme[0].bDROPPED = false;
giveme[0].SetOrigin(pos,false);
giveme[0].Angle = Angle;
giveme[0].Vel = Vel;
@ -714,7 +717,7 @@ Class SWWMDualWeaponGiver : Inventory
giveme[0].ClearCounters();
giveme[0].FloatBobPhase = FloatBobPhase;
// don't forget to reattach its glow
if ( (giveme[1].PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
if ( (giveme[0].PickupFlash is 'SWWMPickupFlash') && swwm_itemglows )
{
let p = Spawn(giveme[0].PickupFlash,giveme[0].Vec3Offset(0,0,16));
p.target = giveme[0];