- Sync scriptbranch with trunk.
SVN r2269 (scripting)
This commit is contained in:
commit
42ac75e894
127 changed files with 2532 additions and 958 deletions
|
|
@ -55,7 +55,6 @@
|
|||
|
||||
static FRandom pr_skullpop ("SkullPop");
|
||||
|
||||
|
||||
// [RH] # of ticks to complete a turn180
|
||||
#define TURN180_TICKS ((TICRATE / 4) + 1)
|
||||
|
||||
|
|
@ -2671,3 +2670,47 @@ void player_t::Serialize (FArchive &arc)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static FPlayerColorSetMap *GetPlayerColors(FName classname)
|
||||
{
|
||||
PClassPlayerPawn *cls = dyn_cast<PClassPlayerPawn>(PClass::FindClass(classname));
|
||||
|
||||
if (cls != NULL)
|
||||
{
|
||||
return cls->ColorSets;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FPlayerColorSet *P_GetPlayerColorSet(FName classname, int setnum)
|
||||
{
|
||||
FPlayerColorSetMap *map = GetPlayerColors(classname);
|
||||
if (map == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
return map->CheckKey(setnum);
|
||||
}
|
||||
|
||||
static int STACK_ARGS intcmp(const void *a, const void *b)
|
||||
{
|
||||
return *(const int *)a - *(const int *)b;
|
||||
}
|
||||
|
||||
void P_EnumPlayerColorSets(FName classname, TArray<int> *out)
|
||||
{
|
||||
out->Clear();
|
||||
FPlayerColorSetMap *map = GetPlayerColors(classname);
|
||||
if (map != NULL)
|
||||
{
|
||||
FPlayerColorSetMap::Iterator it(*map);
|
||||
FPlayerColorSetMap::Pair *pair;
|
||||
|
||||
while (it.NextPair(pair))
|
||||
{
|
||||
out->Push(pair->Key);
|
||||
}
|
||||
qsort(&(*out)[0], out->Size(), sizeof(int), intcmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue