- Changed AWeaponGiver to keep the weapon actor around instead of respawning a new

one for each call.
- Fixed: AWeaponGiver::TryPickup checked the wrong item for ammo to give.
- fixed: FRandom::Random2(int mask) must return the difference between 2 byte values
  for compatibility.
- fixed: The sound name world/volcano/shoot was accidentally destroyed in the source.


SVN r1671 (trunk)
This commit is contained in:
Christoph Oelckers 2009-06-19 21:00:18 +00:00
parent db0a924fc9
commit e11cac7e89
4 changed files with 28 additions and 13 deletions

View file

@ -1,4 +1,12 @@
June 16, 2009 (Changes by Graf Zahl)
June 19, 2009 (Changes by Graf Zahl)
- Changed AWeaponGiver to keep the weapon actor around instead of respawning a new
one for each call.
- Fixed: AWeaponGiver::TryPickup checked the wrong item for ammo to give.
- fixed: FRandom::Random2(int mask) must return the difference between 2 byte values
for compatibility.
- fixed: The sound name world/volcano/shoot was accidentally destroyed in the source.
June 16, 2009 (Changes by Graf Zahl)
- Reintroduced damage thrust clamping but with a higher threshold. The clamping
is now also done in floating point before any fixed point overflows can occur.

View file

@ -173,7 +173,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
blast->momx = FixedMul (1*FRACUNIT, finecosine[angle]);
blast->momy = FixedMul (1*FRACUNIT, finesine[angle]);
blast->momz = (FRACUNIT*5/2) + (pr_blast() << 10);
S_Sound (blast, CHAN_BODY, "world/self/shoot", 1, ATTN_NORM);
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
P_CheckMissileSpawn (blast);
}
}

View file

@ -618,23 +618,30 @@ IMPLEMENT_CLASS(AWeaponGiver)
bool AWeaponGiver::TryPickup(AActor *&toucher)
{
FDropItem *di = GetDropItems();
AWeapon *weap;
if (di != NULL)
{
const PClass *ti = PClass::FindClass(di->Name);
if (ti->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
AWeapon *weap = static_cast<AWeapon*>(Spawn(di->Name, 0, 0, 0, NO_REPLACE));
if (weap != NULL)
if (master == NULL)
{
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
if (weap->AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
if (weap->AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
bool res = weap->CallTryPickup(toucher);
if (!res) weap->Destroy();
else GoAwayAndDie();
return res;
master = weap = static_cast<AWeapon*>(Spawn(di->Name, 0, 0, 0, NO_REPLACE));
if (weap != NULL)
{
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
if (AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
if (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
weap->BecomeItem();
}
else return false;
}
weap = barrier_cast<AWeapon*>(master);
bool res = weap->CallTryPickup(toucher);
if (res) GoAwayAndDie();
return res;
}
}
return false;

View file

@ -69,8 +69,8 @@ public:
// Returns (rand# & mask) - (rand# & mask)
int Random2(int mask)
{
int t = GenRand32() & mask;
return t - (GenRand32() & mask);
int t = GenRand32() & mask & 255;
return t - (GenRand32() & mask & 255);
}
// HITDICE macro used in Heretic and Hexen