File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
gamemodes/terrortown/gamemode/server Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
1111### Changed
1212- Updated Russian and English localization files (by @Satton2 )
1313- Updated the list of troublesome addons used by the addonchecker
14+ - Allow workshop addons to pack rearm scripts (Facepunch/garrysmod/pull/2139, by @figardo )
1415
1516### Fixed
1617
Original file line number Diff line number Diff line change @@ -120,13 +120,20 @@ end
120120---
121121-- Checks whether the given map is able to import @{Entity} based on the map's data
122122-- @param string map
123- -- @return [default=false] boolean
123+ -- @return [default=nil] string The rearm script's file path
124124-- @realm server
125125-- @internal
126126function ents .TTT .CanImportEntities (map )
127127 local fname = " maps/" .. map .. " _ttt.txt"
128+ if file .Exists (fname , " GAME" ) then
129+ return fname
130+ end
128131
129- return file .Exists (fname , " GAME" )
132+ -- Allows workshop addons to pack rearm scripts
133+ fname = " data_static/" .. map .. " _ttt.txt"
134+ if file .Exists (fname , " GAME" ) then
135+ return fname
136+ end
130137end
131138
132139local classremap = {
@@ -142,7 +149,7 @@ local classremap = {
142149-- @internal
143150-- @realm server
144151function ents .TTT .ImportEntities (map )
145- local fname = " maps/ " .. map .. " _ttt.txt "
152+ local fname = ents . TTT . CanImportEntities ( map )
146153 local buf = file .Read (fname , " GAME" )
147154 local lines = string .Explode (" \n " , buf )
148155
You can’t perform that action at this time.
0 commit comments