Spawning empty guns

You can now spawn projectile weapons with nothing loaded in them. Simply
modify the ammo_type of an instance or a class to equal null.

Previously, this would have generated runtime errors.
This commit is contained in:
skull132
2015-06-16 19:48:46 +03:00
parent 6547ef6181
commit 1dc456fff5
+3 -2
View File
@@ -22,8 +22,9 @@
/obj/item/weapon/gun/projectile/New()
..()
for(var/i = 1, i <= max_shells, i++)
loaded += new ammo_type(src)
if(ammo_type) //So that we can have weapons spawn empty.
for(var/i = 1, i <= max_shells, i++)
loaded += new ammo_type(src)
update_icon()
return