File tree Expand file tree Collapse file tree 2 files changed +30
-16
lines changed Expand file tree Collapse file tree 2 files changed +30
-16
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,36 @@ LightmapDeleteCmdlet::LightmapDeleteCmdlet()
110
110
111
111
void LightmapDeleteCmdlet::OnCommand (FArgs args)
112
112
{
113
- RunInGame ([]() {
114
- Printf (" Deleting LIGHTMAP lump!\n " );
113
+ // Pretty lame that we have to load the map here, but cba to figure out how to deal with map loading outside the engine...
114
+
115
+ RunInGame ([&]() {
116
+ FString mapname;
117
+ if (args.NumArgs () > 0 && args.GetArg (0 )[0 ] != ' -' )
118
+ mapname = args.GetArg (0 );
119
+ else
120
+ mapname = " map01" ;
121
+
122
+ G_SetMap (mapname.GetChars (), 0 );
123
+ for (int i = 0 ; i < 100 ; i++)
124
+ {
125
+ D_SingleTick ();
126
+ if (gameaction == ga_nothing)
127
+ break ;
128
+ }
129
+
130
+ if (!level.levelMesh )
131
+ {
132
+ Printf (" No level mesh. Perhaps your level has no lightmap loaded?\n " );
133
+ return ;
134
+ }
135
+
136
+ if (!level.lightmaps )
137
+ {
138
+ Printf (" Lightmap is not enabled in this level.\n " );
139
+ }
140
+
141
+ level.levelMesh ->DeleteLightmapLump (level);
142
+
115
143
});
116
144
}
117
145
Original file line number Diff line number Diff line change @@ -127,20 +127,6 @@ CCMD(invalidatelightmap)
127
127
Printf (" Marked %d out of %d tiles for update.\n " , count, level.levelMesh ->Lightmap .Tiles .Size ());
128
128
}
129
129
130
- CCMD (savelightmap)
131
- {
132
- if (!RequireLightmap ()) return ;
133
-
134
- level.levelMesh ->SaveLightmapLump (level);
135
- }
136
-
137
- CCMD (deletelightmap)
138
- {
139
- if (!RequireLightmap ()) return ;
140
-
141
- level.levelMesh ->DeleteLightmapLump (level);
142
- }
143
-
144
130
CCMD (cpublasinfo)
145
131
{
146
132
if (!level.levelMesh || !level.levelMesh ->Collision )
You can’t perform that action at this time.
0 commit comments