Skip to content

Fix line.sidenum[i] in Lua

Monster Iestyn requested to merge lua-sidenum-fix into next

The bug in #1164 (closed) is that the function to push line.sidenum[i]'s value to Lua wasn't corrected after the changes in !2163 (merged)

I made a test Lua script that makes it easy to check this (the linedef number checked is arbitrary but it works for GFZ1 anyway, no matter). Typing "luatest" in console makes it display a set of print messages about linedef 3 in the map.

local function Test(player)
    print("checking line #3 in map")
    print("frontside userdata: "+lines[3].frontside)
    print("backside userdata: "+lines[3].backside)
    print("frontside is side#"+#lines[3].frontside+" (or "+lines[3].sidenum[0]+")")
    print("backside is side#"+#lines[3].backside+" (or "+lines[3].sidenum[1]+")")
end

COM_AddCommand("luatest", Test)
Edited by Monster Iestyn

Merge request reports