2399,22 → 2399,6 |
return 0; |
} |
|
static void C_ReplaceQuoteSubstring(const size_t q, char const * const query, char const * const replacement) |
{ |
size_t querylength = Bstrlen(query); |
|
for (int i = MAXQUOTELEN - querylength - 2; i >= 0; i--) |
if (Bstrncmp(&ScriptQuotes[q][i], query, querylength) == 0) |
{ |
Bmemset(tempbuf, 0, sizeof(tempbuf)); |
Bstrncpy(tempbuf, ScriptQuotes[q], i); |
Bstrcat(tempbuf, replacement); |
Bstrcat(tempbuf, &ScriptQuotes[q][i + querylength]); |
Bstrncpy(ScriptQuotes[q], tempbuf, MAXQUOTELEN - 1); |
i = MAXQUOTELEN - querylength - 2; |
} |
} |
|
void C_InitQuotes(void) |
{ |
for (int i = 0; i < 128; i++) C_AllocQuote(i); |
2422,13 → 2406,16 |
#ifdef EDUKE32_TOUCH_DEVICES |
ScriptQuotes[QUOTE_DEAD] = 0; |
#else |
char const * const replacement_USE = "USE"; |
if (!Bstrstr(ScriptQuotes[QUOTE_DEAD], replacement_USE)) |
{ |
C_ReplaceQuoteSubstring(QUOTE_DEAD, "SPACE", replacement_USE); |
C_ReplaceQuoteSubstring(QUOTE_DEAD, "OPEN", replacement_USE); |
C_ReplaceQuoteSubstring(QUOTE_DEAD, "ANY BUTTON", replacement_USE); |
} |
for (int i = MAXQUOTELEN - 7; i >= 0; i--) |
if (Bstrncmp(&ScriptQuotes[QUOTE_DEAD][i], "SPACE", 5) == 0) |
{ |
Bmemset(tempbuf, 0, sizeof(tempbuf)); |
Bstrncpy(tempbuf, ScriptQuotes[QUOTE_DEAD], i); |
Bstrcat(tempbuf, "USE"); |
Bstrcat(tempbuf, &ScriptQuotes[QUOTE_DEAD][i + 5]); |
Bstrncpy(ScriptQuotes[QUOTE_DEAD], tempbuf, MAXQUOTELEN - 1); |
i = MAXQUOTELEN - 7; |
} |
#endif |
|
// most of these are based on Blood, obviously |