mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-18 01:31:11 +00:00
make things compile again. aiunicult was removed for now because NBlood doesn't have it anymore.
This commit is contained in:
parent
061d60f911
commit
14464dcd9f
7 changed files with 242 additions and 231 deletions
|
@ -65,7 +65,6 @@
|
|||
#include "src/sfx.cpp"
|
||||
#include "src/sound.cpp"
|
||||
#include "src/tile.cpp"
|
||||
#include "src/triggers.cpp"
|
||||
#include "src/view.cpp"
|
||||
#include "src/warp.cpp"
|
||||
#include "src/weapon.cpp"
|
||||
|
@ -76,6 +75,9 @@
|
|||
#include "src/nnextstr.cpp"
|
||||
#endif
|
||||
|
||||
// after nnsprinsect
|
||||
#include "src/triggers.cpp"
|
||||
|
||||
// This includes the VM so it is last
|
||||
#include "src/vmexports.cpp"
|
||||
#include "src/d_menu.cpp"
|
||||
|
|
|
@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "blood.h"
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
#if 0
|
||||
|
||||
|
||||
BEGIN_BLD_NS
|
||||
|
@ -2658,3 +2659,4 @@ void modernCustomDudeBurningDeath(DBloodActor* actor, int nSeq)
|
|||
|
||||
END_BLD_NS
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -180,6 +180,11 @@ DEF_ANIMATOR(zombaThinkSearch)
|
|||
DEF_ANIMATOR(zombfThinkChase)
|
||||
DEF_ANIMATOR(zombfThinkGoto)
|
||||
DEF_ANIMATOR(zombfThinkSearch)
|
||||
DEF_ANIMATOR(aiPatrolMove)
|
||||
DEF_ANIMATOR(aiPatrolThink)
|
||||
DEF_ANIMATOR(aiPatrolRandGoalAng)
|
||||
DEF_ANIMATOR(aiPatrolTurn)
|
||||
|
||||
// seq callbacks
|
||||
DEF_ANIMATOR(FireballSeqCallback)
|
||||
DEF_ANIMATOR(Fx33Callback)
|
||||
|
|
|
@ -172,60 +172,60 @@ AISTATE genPatrolStates[] = {
|
|||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
{ kAiStatePatrolWaitL, 0, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitL, 7, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitL, 0, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitL, 7, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolMoveL, 9, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveL, 8, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveL, 0, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveL, 6, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveL, 7, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveL, 9, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveL, 8, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveL, 0, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveL, 6, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveL, 7, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolTurnL, 9, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnL, 8, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnL, 0, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnL, 6, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnL, 7, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnL, 9, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnL, 8, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnL, 0, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnL, 6, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnL, 7, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
{ kAiStatePatrolWaitW, 0, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 10, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 13, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 17, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 8, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 9, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitW, 0, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitW, 10, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitW, 13, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitW, 17, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitW, 8, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitW, 9, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolMoveW, 0, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 10, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 13, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 8, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 9, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 7, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 6, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveW, 0, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 10, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 13, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 8, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 9, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 7, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveW, 6, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolTurnW, 0, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 10, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 13, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 8, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 9, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 7, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 6, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnW, 0, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 10, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 13, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 8, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 9, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 7, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnW, 6, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
{ kAiStatePatrolWaitC, 17, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitC, 11, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitC, 10, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitC, 14, nullptr, 0, NULL, NULL, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolWaitC, 17, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitC, 11, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitC, 10, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolWaitC, 14, nullptr, 0, NULL, NULL, &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolMoveC, 14, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveC, 10, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveC, 9, nullptr, 0, NULL, aiPatrolMove, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolMoveC, 14, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveC, 10, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolMoveC, 9, nullptr, 0, NULL, &AF(aiPatrolMove), &AF(aiPatrolThink), NULL },
|
||||
|
||||
{ kAiStatePatrolTurnC, 14, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnC, 10, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnC, 9, nullptr, 0, aiPatrolRandGoalAng, aiPatrolTurn, aiPatrolThink, NULL },
|
||||
{ kAiStatePatrolTurnC, 14, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnC, 10, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
{ kAiStatePatrolTurnC, 9, nullptr, 0, &AF(aiPatrolRandGoalAng), &AF(aiPatrolTurn), &AF(aiPatrolThink), NULL },
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -131,8 +131,6 @@ enum {
|
|||
kModernWindGenerator = 39,
|
||||
kModernRandom = 40,
|
||||
kModernRandom2 = 80,
|
||||
kItemShroomGrow = 129,
|
||||
kItemShroomShrink = 130,
|
||||
kItemModernMapLevel = 150, // once picked up, draws whole minimap
|
||||
kDudeModernCustom = kDudeVanillaMax,
|
||||
kDudeModernCustomBurning = 255,
|
||||
|
|
|
@ -32,265 +32,264 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
|
||||
struct NAMED_TYPE
|
||||
{
|
||||
unsigned int id;
|
||||
const char* text;
|
||||
unsigned int id;
|
||||
const char* text;
|
||||
};
|
||||
|
||||
static const NAMED_TYPE gBoolNames[] =
|
||||
{
|
||||
{ false, "0" },
|
||||
{ true, "1" },
|
||||
{ false, "No" },
|
||||
{ true, "Yes" },
|
||||
{ false, "False" },
|
||||
{ true, "True" },
|
||||
{ false, "0" },
|
||||
{ true, "1" },
|
||||
{ false, "No" },
|
||||
{ true, "Yes" },
|
||||
{ false, "False" },
|
||||
{ true, "True" },
|
||||
};
|
||||
|
||||
const char* enumStrGetChar(int nOffs, char* out, const char* str, char expcr)
|
||||
{
|
||||
int j = ClipLow(nOffs, 0);
|
||||
int i = 0;
|
||||
int j = std::max(nOffs, 0);
|
||||
int i = 0;
|
||||
|
||||
out[0] = '\0';
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
// search for start
|
||||
while (str[i] && j > 0)
|
||||
{
|
||||
if (str[i++] == expcr)
|
||||
j--;
|
||||
}
|
||||
}
|
||||
out[0] = '\0';
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
// search for start
|
||||
while (str[i] && j > 0)
|
||||
{
|
||||
if (str[i++] == expcr)
|
||||
j--;
|
||||
}
|
||||
}
|
||||
|
||||
while (str[i] && str[i] != expcr)
|
||||
out[j++] = str[i++];
|
||||
|
||||
|
||||
out[j] = '\0';
|
||||
|
||||
return (out[0]) ? out : NULL;
|
||||
while (str[i] && str[i] != expcr)
|
||||
out[j++] = str[i++];
|
||||
|
||||
|
||||
out[j] = '\0';
|
||||
|
||||
return (out[0]) ? out : NULL;
|
||||
}
|
||||
|
||||
int enumStr(int nOffs, const char* str, char* key, char* val)
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
const char* pStr;
|
||||
char buffer1[256], buffer2[256], string[256];
|
||||
int t;
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
const char* pStr;
|
||||
char buffer1[256], buffer2[256], string[256];
|
||||
int t;
|
||||
|
||||
if (isarray(str))
|
||||
{
|
||||
t = Bstrlen(str);
|
||||
Bstrcpy(string, str);
|
||||
string[t] = '\0';
|
||||
if (isarray(str))
|
||||
{
|
||||
t = strlen(str);
|
||||
strcpy(string, str);
|
||||
|
||||
pStr = &string[(string[0] == '(')];
|
||||
if (string[t - 1] == ')')
|
||||
string[t - 1] = '\0';
|
||||
pStr = &string[(string[0] == '(')];
|
||||
if (string[t - 1] == ')')
|
||||
string[t - 1] = '\0';
|
||||
|
||||
removeSpaces(string);
|
||||
removeSpaces(string);
|
||||
|
||||
if (enumStrGetChar(nOffs, buffer1, pStr, ','))
|
||||
{
|
||||
if (key)
|
||||
{
|
||||
if (enumStrGetChar(0, buffer2, buffer1, '='))
|
||||
Bsprintf(key, "%s", buffer2);
|
||||
else
|
||||
key[0] = '\0';
|
||||
}
|
||||
if (enumStrGetChar(nOffs, buffer1, pStr, ','))
|
||||
{
|
||||
if (key)
|
||||
{
|
||||
if (enumStrGetChar(0, buffer2, buffer1, '='))
|
||||
sprintf(key, "%s", buffer2);
|
||||
else
|
||||
key[0] = '\0';
|
||||
}
|
||||
|
||||
if (val)
|
||||
{
|
||||
if (enumStrGetChar(1, buffer2, buffer1, '='))
|
||||
{
|
||||
Bsprintf(val, "%s", buffer2);
|
||||
t = ClipLow(Bstrlen(val), 1);
|
||||
if (val[0] == '(' && val[t - 1] != ')')
|
||||
{
|
||||
char tval[256];
|
||||
if (val)
|
||||
{
|
||||
if (enumStrGetChar(1, buffer2, buffer1, '='))
|
||||
{
|
||||
sprintf(val, "%s", buffer2);
|
||||
t = std::max((int)strlen(val), 1);
|
||||
if (val[0] == '(' && val[t - 1] != ')')
|
||||
{
|
||||
char tval[256];
|
||||
|
||||
nOffs++;
|
||||
while ( 1 )
|
||||
{
|
||||
if ((nOffs = enumStr(nOffs, str, tval)) != 0)
|
||||
{
|
||||
t = Bstrlen(tval); Bstrcat(val, ","); Bstrcat(val, tval);
|
||||
if (tval[t - 1] != ')')
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
ThrowError("End of array is not found in \"%s\"", str);
|
||||
}
|
||||
nOffs++;
|
||||
while ( 1 )
|
||||
{
|
||||
if ((nOffs = enumStr(nOffs, str, tval)) != 0)
|
||||
{
|
||||
t = strlen(tval); strcat(val, ","); strcat(val, tval);
|
||||
if (tval[t - 1] != ')')
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
I_Error("End of array is not found in \"%s\"", str);
|
||||
}
|
||||
|
||||
return nOffs;
|
||||
}
|
||||
}
|
||||
return nOffs;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
val[0] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
val[0] = '\0';
|
||||
}
|
||||
|
||||
return ++nOffs;
|
||||
}
|
||||
}
|
||||
return ++nOffs;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int enumStr(int nOffs, const char* str, char* val)
|
||||
{
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
const char* pStr;
|
||||
char string[256];
|
||||
int t;
|
||||
if (!str)
|
||||
return 0;
|
||||
|
||||
const char* pStr;
|
||||
char string[256];
|
||||
int t;
|
||||
|
||||
t = Bstrlen(str);
|
||||
Bstrcpy(string, str);
|
||||
string[t] = '\0';
|
||||
t = strlen(str);
|
||||
strcpy(string, str);
|
||||
string[t] = '\0';
|
||||
|
||||
pStr = &string[(string[0] == '(')];
|
||||
if (string[t - 1] == ')')
|
||||
string[t - 1] = '\0';
|
||||
pStr = &string[(string[0] == '(')];
|
||||
if (string[t - 1] == ')')
|
||||
string[t - 1] = '\0';
|
||||
|
||||
removeSpaces(string);
|
||||
if (enumStrGetChar(nOffs, val, pStr, ','))
|
||||
return ++nOffs;
|
||||
removeSpaces(string);
|
||||
if (enumStrGetChar(nOffs, val, pStr, ','))
|
||||
return ++nOffs;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void removeSpaces(char* str)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
int t = Bstrlen(str);
|
||||
for (int i = t - 1; i >= 0; i--)
|
||||
{
|
||||
if (!isspace(str[i]))
|
||||
continue;
|
||||
if (str)
|
||||
{
|
||||
int t = strlen(str);
|
||||
for (int i = t - 1; i >= 0; i--)
|
||||
{
|
||||
if (!isspace(str[i]))
|
||||
continue;
|
||||
|
||||
for (int j = i; j < t; j++) { str[j] = str[j + 1]; }
|
||||
}
|
||||
}
|
||||
for (int j = i; j < t; j++) { str[j] = str[j + 1]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int btoi(const char* str)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
int i;
|
||||
const NAMED_TYPE* pEntry = gBoolNames;
|
||||
for (i = 0; i < LENGTH(gBoolNames); i++)
|
||||
{
|
||||
if (Bstrcasecmp(str, pEntry->text) == 0)
|
||||
return (bool)pEntry->id;
|
||||
if (str)
|
||||
{
|
||||
int i;
|
||||
const NAMED_TYPE* pEntry = gBoolNames;
|
||||
for (auto & e : gBoolNames)
|
||||
{
|
||||
if (stricmp(str, e.text) == 0)
|
||||
return (bool)e.id;
|
||||
|
||||
pEntry++;
|
||||
}
|
||||
}
|
||||
pEntry++;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
char isbool(const char* str) { return (str && btoi(str) != -1); }
|
||||
char isarray(const char* str, int* nLen)
|
||||
{
|
||||
if (nLen)
|
||||
*nLen = 0;
|
||||
if (nLen)
|
||||
*nLen = 0;
|
||||
|
||||
if (str)
|
||||
{
|
||||
int l = Bstrlen(str);
|
||||
if (l && str[0] == '(' && str[l - 1] == ')')
|
||||
{
|
||||
if (nLen)
|
||||
{
|
||||
*nLen = *nLen + 1;
|
||||
const char* pStr = str;
|
||||
while ((pStr = Bstrchr(pStr, ',')) != NULL)
|
||||
pStr++, * nLen = *nLen + 1;
|
||||
}
|
||||
if (str)
|
||||
{
|
||||
int l = strlen(str);
|
||||
if (l && str[0] == '(' && str[l - 1] == ')')
|
||||
{
|
||||
if (nLen)
|
||||
{
|
||||
*nLen = *nLen + 1;
|
||||
const char* pStr = str;
|
||||
while ((pStr = strchr(pStr, ',')) != NULL)
|
||||
pStr++, * nLen = *nLen + 1;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
char isperc(const char* str)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
int l = Bstrlen(str);
|
||||
if (--l > 0 && str[l] == '%')
|
||||
{
|
||||
while (--l > 0)
|
||||
{
|
||||
if (!isdigit(str[l]))
|
||||
return false;
|
||||
}
|
||||
if (str)
|
||||
{
|
||||
int l = strlen(str);
|
||||
if (--l > 0 && str[l] == '%')
|
||||
{
|
||||
while (--l > 0)
|
||||
{
|
||||
if (!isdigit(str[l]))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isdigit(str[l]) || str[l] == '-' || str[l] == '+')
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (isdigit(str[l]) || str[l] == '-' || str[l] == '+')
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
char isfix(const char* str, char flags)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
int l = Bstrlen(str);
|
||||
if (l > 0)
|
||||
{
|
||||
if (!isdigit(str[0]))
|
||||
{
|
||||
switch (str[0])
|
||||
{
|
||||
case '-':
|
||||
if (!(flags & 0x01)) return false;
|
||||
break;
|
||||
case '+':
|
||||
if (!(flags & 0x02)) return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
if (str)
|
||||
{
|
||||
int l = strlen(str);
|
||||
if (l > 0)
|
||||
{
|
||||
if (!isdigit(str[0]))
|
||||
{
|
||||
switch (str[0])
|
||||
{
|
||||
case '-':
|
||||
if (!(flags & 0x01)) return false;
|
||||
break;
|
||||
case '+':
|
||||
if (!(flags & 0x02)) return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (--l > 0)
|
||||
{
|
||||
if (!isdigit(str[l]))
|
||||
return false;
|
||||
}
|
||||
while (--l > 0)
|
||||
{
|
||||
if (!isdigit(str[l]))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
char isufix(const char* str)
|
||||
{
|
||||
return isfix(str, 0);
|
||||
return isfix(str, 0);
|
||||
}
|
||||
|
||||
char isempty(const char* str)
|
||||
{
|
||||
return (!str || str[0] == '\0');
|
||||
return (!str || str[0] == '\0');
|
||||
}
|
||||
#endif
|
|
@ -244,6 +244,11 @@ native void zombaThinkSearch();
|
|||
native void zombfThinkChase();
|
||||
native void zombfThinkGoto();
|
||||
native void zombfThinkSearch();
|
||||
native void aiPatrolMove();
|
||||
native void aiPatrolThink();
|
||||
native void aiPatrolRandGoalAng();
|
||||
native void aiPatrolTurn();
|
||||
|
||||
native void FireballSeqCallback();
|
||||
native void Fx33Callback();
|
||||
native void NapalmSeqCallback();
|
||||
|
|
Loading…
Reference in a new issue