mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-20 17:17:13 +02:00
Return null entity instances instead of null for the functions that need to return an entity instance.
Finally fix the player unspectating bug and introduce a new event for when a player spectates none. Update the global functions that check for player existance to use the new implementation.
This commit is contained in:
@ -1098,7 +1098,7 @@ LightObj & CPlayer::GetVehicle() const
|
||||
return Core::Get().GetVehicle(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullLightObj();
|
||||
return Core::Get().GetNullVehicle();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1299,7 +1299,7 @@ LightObj & CPlayer::StandingOnVehicle() const
|
||||
return Core::Get().GetVehicle(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullLightObj();
|
||||
return Core::Get().GetNullVehicle();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1316,7 +1316,7 @@ LightObj & CPlayer::StandingOnObject() const
|
||||
return Core::Get().GetObject(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullLightObj();
|
||||
return Core::Get().GetNullObject();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -1342,7 +1342,7 @@ LightObj & CPlayer::GetSpectator() const
|
||||
return Core::Get().GetPlayer(id).mObj;
|
||||
}
|
||||
// Default to a null object
|
||||
return NullLightObj();
|
||||
return Core::Get().GetNullPlayer();
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
@ -2405,7 +2405,7 @@ SQInteger CPlayer::AnnounceEx(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static SQInteger Player_FindAuto(HSQUIRRELVM vm)
|
||||
SQInteger Player_FindAuto(HSQUIRRELVM vm)
|
||||
{
|
||||
// See if a search token was specified
|
||||
if (sq_gettop(vm) <= 1)
|
||||
@ -2493,7 +2493,7 @@ static SQInteger Player_FindAuto(HSQUIRRELVM vm)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
static SQInteger Player_ExistsAuto(HSQUIRRELVM vm)
|
||||
SQInteger Player_ExistsAuto(HSQUIRRELVM vm)
|
||||
{
|
||||
// See if a search token was specified
|
||||
if (sq_gettop(vm) <= 1)
|
||||
|
Reference in New Issue
Block a user