mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix bug in RPak auto completion
RPaks that have a name larger than 123 chars will have their extension delimiter removed due to the way 'CAutoCompleteFileList::AutoCompletionFunc' works. Ideally this functions receives a full rewrite in the SDK to support dynamic extension lengths.
This commit is contained in:
parent
99b057438f
commit
f9245a4070
@ -66,13 +66,13 @@ int _Host_Pak_f_CompletionFunc(CAutoCompleteFileList* autocomplete, char const*
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
size_t cmdsize = strlen(commands[i]);
|
||||
if (cmdsize < COMMAND_COMPLETION_ITEM_LENGTH - 4)
|
||||
if (cmdsize < COMMAND_COMPLETION_ITEM_LENGTH - 5)
|
||||
{
|
||||
snprintf(&commands[i][cmdsize], 5, "%s", "rpak");
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(commands[i], COMMAND_COMPLETION_ITEM_LENGTH, "%s", "BUFFER_TOO_SMALL");
|
||||
snprintf(commands[i], COMMAND_COMPLETION_ITEM_LENGTH, "%s", "BUFFER_TOO_SMALL!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user