mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
Fixed hook on courses
Fixed course loading if it's not compressed
This commit is contained in:
parent
71b7b0e879
commit
6fd0f963ba
4 changed files with 9 additions and 7 deletions
4
FIXES.md
4
FIXES.md
|
@ -7,4 +7,6 @@
|
|||
* Возможность удалять зиплайны от Zipline Gun на ПКМ.
|
||||
|
||||
# Фиксы с предыдущей версии
|
||||
* Теперь точно починил сохранение курсов.
|
||||
* Теперь точно починил сохранение курсов.
|
||||
* Фикс раскачивающихся верёвок в курсах.
|
||||
* Фикс загрузки курса если он не сжат.
|
|
@ -53,11 +53,11 @@ function OpenCourseMenu(ply)
|
|||
|
||||
for k, v in pairs(files) do
|
||||
local data = file.Read(dir .. v, "DATA")
|
||||
data = util.Decompress(data)
|
||||
course = util.Decompress(data) or data
|
||||
|
||||
if data then
|
||||
data = util.JSONToTable(data)
|
||||
local courseentry = AEUI:AddText(courselist, data[5] or "ERROR", "AEUILarge", 10, 40 * #courselist.elements)
|
||||
if course then
|
||||
course = util.JSONToTable(course)
|
||||
local courseentry = AEUI:AddText(courselist, course[5] or "ERROR", "AEUILarge", 10, 40 * #courselist.elements)
|
||||
courseentry.courseid = v:Split(".txt")[1]
|
||||
|
||||
function courseentry:onclick()
|
||||
|
|
|
@ -52,7 +52,7 @@ local zpunchstart = Angle(2, 0, 0)
|
|||
|
||||
hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||
if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end
|
||||
if not ply:Alive() or Course_Name ~= "" then return end
|
||||
if not ply:Alive() or (Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 and not ply:GetNW2Entity("Swingrope")) then return end
|
||||
if GetGlobalBool(GM_INFECTION) --[[and not ply:GetNW2Entity("Swingrope")]] then return end
|
||||
|
||||
local activewep = ply:GetActiveWeapon()
|
||||
|
|
|
@ -602,7 +602,7 @@ if SERVER then
|
|||
function Beatrun_ReadCourse(data)
|
||||
game.CleanUpMap()
|
||||
|
||||
local a = util.Decompress(data)
|
||||
local a = util.Decompress(data) or data
|
||||
local crc = util.CRC(a)
|
||||
local data = util.JSONToTable(a)
|
||||
|
||||
|
|
Loading…
Reference in a new issue