Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Lua Error Report

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
9/7/2025 5:37:00 PMPLrankOTrWasYoda before revert after revert
9/7/2025 5:35:43 PMPLrankOTrWasYoda before revert after revert
9/7/2025 5:35:26 PMPLrankOTrWasYoda before revert after revert
9/7/2025 5:35:15 PMPLrankOTrWasYoda before revert after revert
9/7/2025 5:16:11 PMPLrankOTrWasYoda before revert after revert
9/6/2025 10:21:06 PMPLrankOTrWasYoda before revert after revert
Before After
1 Lua crashes with this error: 1 Lua crashes with this error:
2 [img]https://i.ibb.co/0V8vp4zc/ERROR.png[/img] 2 [img]https://i.ibb.co/0V8vp4zc/ERROR.png[/img]
3 \n 3 \n
4 [s]Under these circumstances: 4 [s]Under these circumstances:
5 1. 5 1.
6 o = math.random(#guns) 6 o = math.random(#guns)
7 table.insert(ud.weapons, guns[o][1]) 7 table.insert(ud.weapons, guns[o][1])
8 ud.weapondefs[guns[o][2]] = guns[o][3] 8 ud.weapondefs[guns[o][2]] = guns[o][3]
9 \n 9 \n
10 NOTE: Replacing the first line with o = 1 doesnt cause a crash 10 NOTE: Replacing the first line with o = 1 doesnt cause a crash
11 \n 11 \n
12 2. 12 2.
13 \n 13 \n
14 table.remove(guns, 1) 14 table.remove(guns, 1)
15 \n 15 \n
16 NOTE: table.remove(guns) doesnt crash 16 NOTE: table.remove(guns) doesnt crash
17 ¨[/s] 17 ¨[/s]
18 \n 18 \n
19 [b]EDIT: I narrowed the problem down to this:[/b] 19 [b]EDIT: I narrowed the problem down to this:[/b]
20 \n 20 \n
21 new_w = {} 21 new_w = {}
22 for _, _ in new_w do 22 for k, v in new_w do
23 end 23 end
24 \n 24 \n
25 Whenever Zero Ks Lua loops over an empty array, it crashes. Unbelievable! 25 Whenever Zero Ks Lua loops over an empty array, it crashes. Unbelievable!
26 \n 26 \n
27 Code above for replication: 27 Code above for replication:
28 bmV3X3cgPSB7fQpmb3IgXywgXyBpbiBuZXdfdyBkbwplbmQK 28 bmV3X3cgPSB7fQpmb3IgXywgXyBpbiBuZXdfdyBkbwplbmQK
29 \n 29 \n