.vector portal_safe_origin;
.float portal_wants_to_vanish;
.float portal_activatetime;
+.float savemodelindex;
float PlayerEdgeDistance(entity p, vector v)
{
// factor -1 allows chaining portals, but may be weird
player.right_vector = -1 * AnglesTransform_Apply(transform, player.right_vector);
- if(player.flagcarried)
- DropFlag(player.flagcarried, player, world);
+ entity oldself = self;
+ self = player;
+ MUTATOR_CALLHOOK(PortalTeleport);
+ player = self;
+ self = oldself;
if not(teleporter.enemy)
{
{
portal.skin = 2;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = 0;
portal.nextthink = 0;
portal.takedamage = DAMAGE_NO;
{
portal.skin = 2;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = EF_ADDITIVE;
portal.nextthink = 0;
portal.takedamage = DAMAGE_YES;
{
portal.skin = 1;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = EF_STARDUST | EF_BLUE;
portal.nextthink = 0;
portal.takedamage = DAMAGE_YES;
other = other.enemy;
if(other == self.aiment)
{
- self.modelindex = self.modelindex_lod0;
+ self.modelindex = self.savemodelindex;
}
else if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(self.aiment))
{
}
else
{
- self.modelindex = self.modelindex_lod0;
+ self.modelindex = self.savemodelindex;
}
return TRUE;
}
portal.fade_time = time + autocvar_g_balance_portal_lifetime;
portal.health = autocvar_g_balance_portal_health;
setmodel(portal, "models/portal.md3");
- portal.modelindex_lod0 = portal.modelindex;
+ portal.savemodelindex = portal.modelindex;
portal.customizeentityforclient = Portal_Customize;
if(!Portal_FindSafeOrigin(portal))
portal = Portal_Spawn(own, org, ang);
if(!portal)
- {
- // if(!own.portal_out || own.portal_out.portal_id == portal_id_val)
- Portal_ClearAll_PortalsOnly(own);
return 0;
- }
portal.portal_id = portal_id_val;
Portal_SetInPortal(own, portal);
portal = Portal_Spawn(own, org, ang);
if(!portal)
- {
- // if(!own.portal_in || own.portal_in.portal_id == portal_id_val)
- Portal_ClearAll_PortalsOnly(own);
return 0;
- }
portal.portal_id = portal_id_val;
Portal_SetOutPortal(own, portal);