mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 08:30:49 +00:00
9ae272d753
- scriptified all Effect functions of Fastprojectile's children - implemented access to class meta data. - added a VM instruction to retrieve the class metadata, to eliminate the overhead of the function call that would otherwise be needed. - made GetClass() a builtin so that it can use the new instruction Important note about this commit: Scriptifying CFlameMissile::Effect revealed a problem with the virtual function interface: In order to work, this needs to be explicitly enabled for each single native class that may be used as a base for a scripted class. Needless to say, this will end up way too much work, as there are over 100 native classes, excluding those which will be scriptified. But in order to fix the problem this partially broken state needs to be committed first.
41 lines
659 B
Text
41 lines
659 B
Text
// Fast projectiles --------------------------------------------------------
|
|
|
|
class FastProjectile : Actor native
|
|
{
|
|
Default
|
|
{
|
|
Projectile;
|
|
MissileHeight 0;
|
|
}
|
|
|
|
|
|
virtual void Effect()
|
|
{
|
|
class<Actor> trail = MissileName;
|
|
if (trail != null)
|
|
{
|
|
double hitz = pos.z - 8;
|
|
|
|
if (hitz < floorz)
|
|
{
|
|
hitz = floorz;
|
|
}
|
|
// Do not clip this offset to the floor.
|
|
hitz += MissileHeight;
|
|
|
|
Actor act = Spawn (trail, (pos.xy, hitz), ALLOW_REPLACE);
|
|
if (act != null)
|
|
{
|
|
if (bGetOwner && target != null)
|
|
act.target = target;
|
|
else
|
|
act.target = self;
|
|
|
|
act.angle = angle;
|
|
act.pitch = pitch;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|