mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-26 05:51:30 +00:00
- owner wrapper stuff
This commit is contained in:
parent
11f459cd83
commit
372cfbc4e1
1 changed files with 18 additions and 0 deletions
|
@ -27,10 +27,28 @@ public:
|
|||
|
||||
DWHActor* GetOwner()
|
||||
{
|
||||
if (s().owner >= 4096) return nullptr; // player index hackery
|
||||
if (s().owner == -1 || s().owner == MAXSPRITES - 1) return nullptr;
|
||||
return base() + s().owner;
|
||||
}
|
||||
|
||||
void SetPlayerOwner(int num)
|
||||
{
|
||||
s().owner = num + 4096; // caution! This needs to be changed later!!!
|
||||
}
|
||||
|
||||
int GetPlayerOwner()
|
||||
{
|
||||
if (s().owner >= 4096) return s().owner - 4096;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// we need this because the owner later needs to be split up - but some stuff copies the value without checking.
|
||||
void CopyOwner(DWHActor* other)
|
||||
{
|
||||
s().owner = other->s().owner;
|
||||
}
|
||||
|
||||
int GetSpriteIndex() const
|
||||
{
|
||||
return index;
|
||||
|
|
Loading…
Reference in a new issue