Skip to content

Commit

Permalink
const qualify mapmodel command paramaters
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Jan 18, 2024
1 parent 274cb63 commit 22124ec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/engine/render/rendermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::vector<mapmodelinfo> mapmodels;
static const char * const mmprefix = "mapmodel/";
static const int mmprefixlen = std::strlen(mmprefix);

void mapmodel(char *name)
void mapmodel(const char *name)
{
mapmodelinfo mmi;
if(name[0])
Expand All @@ -84,7 +84,7 @@ void mapmodel(char *name)
mapmodels.push_back(mmi);
}

void mapmodelreset(int *n)
void mapmodelreset(const int *n)
{
if(!(identflags&Idf_Overridden) && !allowediting)
{
Expand All @@ -98,15 +98,15 @@ const char *mapmodelname(int i)
return (static_cast<int>(mapmodels.size()) > i) ? mapmodels[i].name.c_str() : nullptr;
}

void mapmodelnamecmd(int *index, int *prefix)
void mapmodelnamecmd(const int *index, const int *prefix)
{
if(static_cast<int>(mapmodels.size()) > *index)
{
result(mapmodels[*index].name.empty() ? mapmodels[*index].name.c_str() + (*prefix ? 0 : mmprefixlen) : "");
}
}

void mapmodelloaded(int *index)
void mapmodelloaded(const int *index)
{
intret(static_cast<int>(mapmodels.size()) > *index && mapmodels[*index].m ? 1 : 0);
}
Expand Down Expand Up @@ -305,6 +305,7 @@ model *loadmodel(const char *name, int i, bool msg)
return m;
}

//used in iengine.h
void clear_models()
{
for(auto [k, i] : models)
Expand Down

0 comments on commit 22124ec

Please sign in to comment.