mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-08 10:40:46 +00:00
51b05d331d
- Converted P_MovePlayer and all associated variables to floating point because this wasn't working well with a mixture between float and fixed. Like the angle commit this has just been patched up to compile, the bulk of work is yet to be done.
51 lines
937 B
C++
51 lines
937 B
C++
#include "actor.h"
|
|
#include "info.h"
|
|
#include "m_random.h"
|
|
#include "m_fixed.h"
|
|
|
|
static FRandom pr_dirt ("SpawnDirt");
|
|
|
|
// Stained glass ------------------------------------------------------------
|
|
|
|
class AGlassShard : public AActor
|
|
{
|
|
DECLARE_CLASS (AGlassShard, AActor)
|
|
public:
|
|
bool FloorBounceMissile (secplane_t &plane)
|
|
{
|
|
if (!Super::FloorBounceMissile (plane))
|
|
{
|
|
if (fabs (Vel.Z) < 0.5)
|
|
{
|
|
Destroy ();
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
IMPLEMENT_CLASS(AGlassShard)
|
|
|
|
// Dirt stuff
|
|
|
|
void P_SpawnDirt (AActor *actor, fixed_t radius)
|
|
{
|
|
PClassActor *dtype = NULL;
|
|
AActor *mo;
|
|
|
|
fixed_t zo = (pr_dirt() << 9) + FRACUNIT;
|
|
fixedvec3 pos = actor->_f_Vec3Angle(radius, pr_dirt() << 24, zo);
|
|
|
|
char fmt[8];
|
|
mysnprintf(fmt, countof(fmt), "Dirt%d", 1 + pr_dirt()%6);
|
|
dtype = PClass::FindActor(fmt);
|
|
if (dtype)
|
|
{
|
|
mo = Spawn (dtype, pos, ALLOW_REPLACE);
|
|
if (mo)
|
|
{
|
|
mo->Vel.Z = pr_dirt() / 64.;
|
|
}
|
|
}
|
|
}
|