cannon: fix possible nil pointer access

In boomshire, the cannons are automatically filled with boompacks (and then fired). That means that there is no Clonk to be passed.
objectmenu
David Dormagen 2016-01-25 20:13:51 +01:00
parent 36489145b6
commit 9e563e6d8c
1 changed files with 2 additions and 1 deletions

View File

@ -249,7 +249,8 @@ protected func DoFire(object iammo, object clonk, int angle)
iammo->SetR(r / angPrec);
iammo->SetRDir(-4 + Random(9));
iammo->LaunchProjectile(r, 17, Fire_Velocity, 0,0, angPrec);
iammo->SetController(clonk->GetController());
if (clonk)
iammo->SetController(clonk->GetController());
iammo->~Fuse();
//Particles