mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
[MIRROR] Replaces a portion of C-style for loops with the more commonplace for loops, which are faster. [MDB IGNORE] (#9298)
* Replaces a portion of C-style for loops with the more commonplace for loops, which are faster. * Update code/modules/projectiles/boxes_magazines/_box_magazine.dm Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com> Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@
|
||||
stack_trace("Tried loading unsupported ammocasing type [load_type] into ammo box [type].")
|
||||
return
|
||||
|
||||
for(var/i = max(1, stored_ammo.len), i <= max_ammo, i++)
|
||||
for(var/i in max(1, stored_ammo.len) to max_ammo)
|
||||
stored_ammo += new round_check() //SKYRAT EDTI CHANGE - SEC_HUAL - Moving to nullspace seems to help with lag.
|
||||
update_ammo_count()
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
if(!load_type)
|
||||
load_type = ammo_type
|
||||
|
||||
for(var/i = 1, i <= max_ammo, i++)
|
||||
for(var/i in 1 to max_ammo)
|
||||
if(!give_round(new load_type(src)))
|
||||
break
|
||||
update_appearance()
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
/obj/item/gun/energy/proc/update_ammo_types()
|
||||
var/obj/item/ammo_casing/energy/shot
|
||||
for (var/i = 1, i <= ammo_type.len, i++)
|
||||
for (var/i in 1 to ammo_type.len)
|
||||
var/shottype = ammo_type[i]
|
||||
shot = new shottype(src)
|
||||
ammo_type[i] = shot
|
||||
|
||||
Reference in New Issue
Block a user