Skip to content

Commit 3c23c42

Browse files
author
nitrocaster
committed
Add FS:exist script function overload.
1 parent 0695376 commit 3c23c42

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/xrGame/fs_registrator_script.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ LPCSTR get_file_age_str(CLocatorAPI* fs, LPCSTR nm)
152152
return asctime( newtime );
153153
}
154154

155+
static const CLocatorAPI::file *ExistS(CLocatorAPI *fs, const char *path, const char *name)
156+
{
157+
string_path temp;
158+
fs->update_path(temp, path, name);
159+
return fs->GetFileDesc(temp);
160+
}
161+
155162
#pragma optimize("s",on)
156163
void fs_registrator::script_register(lua_State *L)
157164
{
@@ -231,6 +238,7 @@ void fs_registrator::script_register(lua_State *L)
231238
.def("file_length", &CLocatorAPI::file_length)
232239
.def("file_copy", &CLocatorAPI::file_copy)
233240

241+
.def("exist", &ExistS)
234242
.def("exist", (FileStatus (CLocatorAPI::*)(LPCSTR, FSType))(&CLocatorAPI::exist))
235243
.def("exist", (FileStatus (CLocatorAPI::*)(LPCSTR, LPCSTR, FSType))(&CLocatorAPI::exist))
236244

0 commit comments

Comments
 (0)