- Updated scripting branch to latest version in trunk.
SVN r4337 (scripting)
This commit is contained in:
commit
459ad5abff
282 changed files with 15968 additions and 3535 deletions
|
|
@ -83,6 +83,10 @@ void AWeapon::Serialize (FArchive &arc)
|
|||
}
|
||||
arc << FOVScale
|
||||
<< Crosshair;
|
||||
if (SaveVersion >= 4203)
|
||||
{
|
||||
arc << MinSelAmmo1 << MinSelAmmo2;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
@ -328,7 +332,7 @@ void AWeapon::AttachToOwner (AActor *other)
|
|||
SisterWeapon = AddWeapon (SisterWeaponType);
|
||||
if (Owner->player != NULL)
|
||||
{
|
||||
if (!Owner->player->userinfo.neverswitch && !(WeaponFlags & WIF_NO_AUTO_SWITCH))
|
||||
if (!Owner->player->userinfo.GetNeverSwitch() && !(WeaponFlags & WIF_NO_AUTO_SWITCH))
|
||||
{
|
||||
Owner->player->PendingWeapon = this;
|
||||
}
|
||||
|
|
@ -719,16 +723,17 @@ FState *AWeapon::GetZoomState ()
|
|||
|
||||
/* Weapon giver ***********************************************************/
|
||||
|
||||
class AWeaponGiver : public AWeapon
|
||||
{
|
||||
DECLARE_CLASS(AWeaponGiver, AWeapon)
|
||||
|
||||
public:
|
||||
bool TryPickup(AActor *&toucher);
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS(AWeaponGiver)
|
||||
|
||||
void AWeaponGiver::Serialize(FArchive &arc)
|
||||
{
|
||||
Super::Serialize(arc);
|
||||
if (SaveVersion >= 4246)
|
||||
{
|
||||
arc << DropAmmoFactor;
|
||||
}
|
||||
}
|
||||
|
||||
bool AWeaponGiver::TryPickup(AActor *&toucher)
|
||||
{
|
||||
DDropItem *di = GetDropItems();
|
||||
|
|
@ -746,8 +751,17 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
|
|||
{
|
||||
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
|
||||
weap->flags = (weap->flags & ~MF_DROPPED) | (this->flags & MF_DROPPED);
|
||||
|
||||
// If our ammo gives are non-negative, transfer them to the real weapon.
|
||||
if (AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
|
||||
if (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
|
||||
|
||||
// If DropAmmoFactor is non-negative, modify the given ammo amounts.
|
||||
if (DropAmmoFactor > 0)
|
||||
{
|
||||
weap->AmmoGive1 = FixedMul(weap->AmmoGive1, DropAmmoFactor);
|
||||
weap->AmmoGive2 = FixedMul(weap->AmmoGive2, DropAmmoFactor);
|
||||
}
|
||||
weap->BecomeItem();
|
||||
}
|
||||
else return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue