mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-11 13:21:49 +00:00
dd2ea96d6c
* DObjects may not be memset to 0. * There was still code trying to retrieve the player index with pointer artithmetic. With an array of pointers this does not work.
36 lines
819 B
C
36 lines
819 B
C
#pragma once
|
|
#include "dobject.h"
|
|
#include "build.h"
|
|
|
|
BEGIN_DUKE_NS
|
|
|
|
|
|
using DukeStatIterator = TStatIterator<DDukeActor>;
|
|
using DukeSectIterator = TSectIterator<DDukeActor>;
|
|
using DukeSpriteIterator = TSpriteIterator<DDukeActor>;
|
|
|
|
inline DDukeActor* DDukePlayer::GetActor()
|
|
{
|
|
return static_cast<DDukeActor*>(actor);
|
|
}
|
|
|
|
inline int DDukePlayer::GetPlayerNum()
|
|
{
|
|
return GetActor()->PlayerIndex();
|
|
}
|
|
|
|
DDukeActor* spawn(DDukeActor* spawner, PClassActor* pname);
|
|
DDukeActor* spawnsprite(DDukeActor* origin, int typeId);
|
|
|
|
// return type is int for scripting - the value must still be true or false!
|
|
inline int badguy(const DDukeActor* pSprite)
|
|
{
|
|
return !!(pSprite->flags1 & (SFLAG_BADGUY | SFLAG_INTERNAL_BADGUY));
|
|
}
|
|
|
|
inline int bossguy(const DDukeActor* pSprite)
|
|
{
|
|
return !!(pSprite->flags1 & SFLAG_BOSS);
|
|
}
|
|
|
|
END_DUKE_NS
|