Skip to content

Commit 365a921

Browse files
Rip-Rip-Ripozxybox
authored andcommitted
Use .len() instead of custom function.
1 parent 9fc53b9 commit 365a921

2 files changed

Lines changed: 1 addition & 7 deletions

File tree

light_bridge_lights/scripts/vscripts/light_bridge_lights/helper.nut

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,5 @@ if(!("LBL_Dev" in getroottable())) {
1717
function distance(vec1, vec2) {
1818
return (vec1 - vec2).Length()
1919
}
20-
21-
function numOfItemsInTable(table) {
22-
local count = 0
23-
foreach(item in table) count++
24-
return count
25-
}
2620
}
2721
}

light_bridge_lights/scripts/vscripts/sv_init.nut

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function LBL_bridgeCacheRefresh() {
117117
}
118118

119119
for(local bridge = null; bridge = Entities.FindByClassname(bridge, "projected_wall_entity");) {
120-
if(LBL_bridgeIsCached(bridge) || !bridge.IsValid() || LBL_Dev.numOfItemsInTable(LBL_bridgesCached) >= LBL_MAX_NUMBER_OF_LIT_BRIDGES) continue // skip cached bridges or invalid bridges, and prevent too many lit bridges to prevent crashes
120+
if(LBL_bridgeIsCached(bridge) || !bridge.IsValid() || LBL_bridgesCached.len() >= LBL_MAX_NUMBER_OF_LIT_BRIDGES) continue // skip cached bridges or invalid bridges, and prevent too many lit bridges to prevent crashes
121121

122122
// update cache with new bridge
123123

0 commit comments

Comments
 (0)