Hotfix: Crash when enemies are killed without inflictor/source.
This commit is contained in:
parent
32afdb2cee
commit
530d2ed1ea
1 changed files with 3 additions and 3 deletions
|
|
@ -3546,10 +3546,10 @@ Class UTMainHandler : EventHandler
|
||||||
if ( !e.Thing.player && !e.Thing.bIsMonster && !e.Thing.bCountKill ) return;
|
if ( !e.Thing.player && !e.Thing.bIsMonster && !e.Thing.bCountKill ) return;
|
||||||
if ( (e.Inflictor && e.Inflictor.player && (e.Inflictor != e.Thing)) || (e.DamageSource && e.DamageSource.player && (e.DamageSource != e.Thing)) )
|
if ( (e.Inflictor && e.Inflictor.player && (e.Inflictor != e.Thing)) || (e.DamageSource && e.DamageSource.player && (e.DamageSource != e.Thing)) )
|
||||||
{
|
{
|
||||||
Weapon saw = Weapon(e.Inflictor.FindInventory("UTChainsaw"));
|
Weapon saw = Weapon(e.Inflictor?e.Inflictor.FindInventory("UTChainsaw"):null);
|
||||||
if ( !saw ) saw = Weapon(e.DamageSource.FindInventory("UTChainsaw"));
|
if ( !saw ) saw = Weapon(e.DamageSource?e.DamageSource.FindInventory("UTChainsaw"):null);
|
||||||
bool current = false;
|
bool current = false;
|
||||||
if ( e.Inflictor.player && e.Inflictor.player.ReadyWeapon == saw ) current = true;
|
if ( e.Inflictor.player && (e.Inflictor.player.ReadyWeapon == saw) ) current = true;
|
||||||
if ( e.DamageSource.player && (e.DamageSource.player.ReadyWeapon == saw) ) current = true;
|
if ( e.DamageSource.player && (e.DamageSource.player.ReadyWeapon == saw) ) current = true;
|
||||||
if ( flak_sawammo && saw && (saw.Ammo1.Amount < 40) && !current && !Random[SawDrop](0,9) )
|
if ( flak_sawammo && saw && (saw.Ammo1.Amount < 40) && !current && !Random[SawDrop](0,9) )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue