evtl fix taxifahrer fehler
This commit is contained in:
@@ -6,10 +6,18 @@ class RageEntity implements IEntity {
|
|||||||
private entity: EntityMp;
|
private entity: EntityMp;
|
||||||
|
|
||||||
get id(): number {
|
get id(): number {
|
||||||
|
if (!this.entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return this.entity.id;
|
return this.entity.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
get remoteId(): number {
|
get remoteId(): number {
|
||||||
|
if (!this.entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return this.entity.remoteId;
|
return this.entity.remoteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,6 +26,10 @@ class RageEntity implements IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get type(): EntityType {
|
get type(): EntityType {
|
||||||
|
if (!this.entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
switch (this.entity.type) {
|
switch (this.entity.type) {
|
||||||
case 'vehicle': return EntityType.Vehicle;
|
case 'vehicle': return EntityType.Vehicle;
|
||||||
case 'player': return EntityType.Player;
|
case 'player': return EntityType.Player;
|
||||||
@@ -26,6 +38,10 @@ class RageEntity implements IEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSharedData<T>(key: string): T {
|
getSharedData<T>(key: string): T {
|
||||||
|
if (!this.entity) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var data = this.entity.getVariable(key);
|
var data = this.entity.getVariable(key);
|
||||||
if (typeof data !== 'undefined') {
|
if (typeof data !== 'undefined') {
|
||||||
return parseJson<T>(<string>data);
|
return parseJson<T>(<string>data);
|
||||||
@@ -45,11 +61,19 @@ class RagePlayer extends RageEntity implements IPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get vehicle(): IVehicle {
|
get vehicle(): IVehicle {
|
||||||
|
if (!this.player) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var veh: VehicleMp = this.player.vehicle;
|
var veh: VehicleMp = this.player.vehicle;
|
||||||
return veh ? new RageVehicle(veh) : null;
|
return veh ? new RageVehicle(veh) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get inVehicle(): boolean {
|
get inVehicle(): boolean {
|
||||||
|
if (!this.player) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return this.player.isInAnyVehicle(false);
|
return this.player.isInAnyVehicle(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -388,7 +388,11 @@ namespace ReallifeGamemode.Server.Managers
|
|||||||
public void JobManagerPlayerEnterVehicle(Player player, Vehicle veh, sbyte seat)
|
public void JobManagerPlayerEnterVehicle(Player player, Vehicle veh, sbyte seat)
|
||||||
{
|
{
|
||||||
ServerVehicle sVeh = veh.GetServerVehicle();
|
ServerVehicle sVeh = veh.GetServerVehicle();
|
||||||
//if (sVeh == null) return;
|
if (sVeh == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (seat != 0)
|
if (seat != 0)
|
||||||
{
|
{
|
||||||
if (sVeh is JobVehicle jV && jV.JobId == 1) // Spieler steigt in Taxi ein
|
if (sVeh is JobVehicle jV && jV.JobId == 1) // Spieler steigt in Taxi ein
|
||||||
|
|||||||
Reference in New Issue
Block a user