I can confirm something is seriously wacky here. Here is the code, and i didn't change a thing.
Code:
// charging up weapon...
//
if(((attack==wSword && attackclk==SWORDCHARGEFRAME && itemid>=0 && isWpnPressed(itype_sword)) ||
#if 0
(attack==wWand && attackclk==WANDCHARGEFRAME && itemid>=0 isWpnPressed(itype_wand)) ||
#endif
(attack==wHammer && attackclk==HAMMERCHARGEFRAME && itemid>=0 && isWpnPressed(itype_hammer))) && z==0 && checkmagiccost(itemid)) //this check prevents that
{
// Increase charging while holding down button.
if(spins==0 && charging<magiccharge)
charging++;
// Once a charging threshold is reached, play the sound.
if(charging==normalcharge)
{
paymagiccost(itemid);
sfx(WAV_ZN1CHARGE,pan(int(x)));
}
else
{
itemid = current_item_id(attack==wHammer ? itype_quakescroll2 : itype_spinscroll2);
if(itemid>-1 && charging==magiccharge && checkmagiccost(itemid))
{
paymagiccost(itemid);
charging++; // charging>magiccharge signifies a successful supercharge.
sfx(WAV_ZN1CHARGE2,pan(int(x)));
}
}
}