- block direct use of 'new' for DObjects.
This is to ensure that the Class pointer can be set right on creation. ZDoom had always depended on handling this lazily which poses some problems for the VM. So now there is a variadic Create<classtype> function taking care of that, but to ensure that it gets used, direct access to the new operator has been blocked. This also neccessitated making DArgs a regular object because they get created before the type system is up. Since the few uses of DArgs are easily controllable this wasn't a big issue. - did a bit of optimization on the bots' decision making whether to pick up a health item or not.
This commit is contained in:
parent
929affa3cb
commit
cd180d29c7
68 changed files with 384 additions and 341 deletions
|
|
@ -390,7 +390,7 @@ bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle,
|
|||
// cannot do rotations on linked polyportals.
|
||||
break;
|
||||
}
|
||||
pe = new DRotatePoly(poly->tag);
|
||||
pe = Create<DRotatePoly>(poly->tag);
|
||||
poly->specialdata = pe;
|
||||
poly->bBlocked = false;
|
||||
if (byteAngle != 0)
|
||||
|
|
@ -472,7 +472,7 @@ bool EV_MovePoly (line_t *line, int polyNum, double speed, DAngle angle,
|
|||
{ // poly is already in motion
|
||||
break;
|
||||
}
|
||||
pe = new DMovePoly(poly->tag);
|
||||
pe = Create<DMovePoly>(poly->tag);
|
||||
poly->specialdata = pe;
|
||||
poly->bBlocked = false;
|
||||
pe->m_Dist = dist; // Distance
|
||||
|
|
@ -554,7 +554,7 @@ bool EV_MovePolyTo(line_t *line, int polyNum, double speed, const DVector2 &targ
|
|||
{ // poly is already in motion
|
||||
break;
|
||||
}
|
||||
pe = new DMovePolyTo(poly->tag);
|
||||
pe = Create<DMovePolyTo>(poly->tag);
|
||||
poly->specialdata = pe;
|
||||
poly->bBlocked = false;
|
||||
pe->m_Dist = distlen;
|
||||
|
|
@ -709,7 +709,7 @@ bool EV_OpenPolyDoor(line_t *line, int polyNum, double speed, DAngle angle, int
|
|||
break;
|
||||
}
|
||||
|
||||
pd = new DPolyDoor(poly->tag, type);
|
||||
pd = Create<DPolyDoor>(poly->tag, type);
|
||||
poly->specialdata = pd;
|
||||
if (type == PODOOR_SLIDE)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue