Skip to content

Commit 615444c

Browse files
committed
fix serverside blips
1 parent fb3557d commit 615444c

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

api/AltV.Net.Async/Elements/Entities/AsyncBlip.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Diagnostics.CodeAnalysis;
44
using System.Numerics;
@@ -13,7 +13,6 @@ public class AsyncBlip : AsyncWorldObject, IBlip, IAsyncConvertible<IBlip>
1313
{
1414
protected readonly IBlip Blip;
1515
public IntPtr BlipNativePointer => Blip.BlipNativePointer;
16-
bool IBlip.IsGlobal { get; set; }
1716
public void AddTargetPlayer(IPlayer player)
1817
{
1918
lock (Blip)
@@ -61,8 +60,6 @@ public bool IsGlobal
6160
}
6261
}
6362

64-
byte IBlip.BlipType { get; set; }
65-
6663
public bool IsAttached
6764
{
6865
get
@@ -97,6 +94,13 @@ public byte BlipType
9794
return Blip.BlipType;
9895
}
9996
}
97+
set {
98+
lock (Blip)
99+
{
100+
if (!AsyncContext.CheckIfExistsNullable(Blip)) return;
101+
Blip.BlipType = value;
102+
}
103+
}
100104
}
101105

102106
public uint Sprite

api/AltV.Net/Elements/Entities/Blip.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace AltV.Net.Elements.Entities
1212
public class Blip : WorldObject, IBlip
1313
{
1414
public IntPtr BlipNativePointer { get; }
15-
bool IBlip.IsGlobal { get; set; }
1615
public void AddTargetPlayer(IPlayer player)
1716
{
1817
unsafe
@@ -72,10 +71,16 @@ public bool IsGlobal
7271
return Core.Library.Shared.Blip_IsGlobal(BlipNativePointer) == 1;
7372
}
7473
}
74+
set
75+
{
76+
unsafe
77+
{
78+
CheckIfEntityExists();
79+
Core.Library.Server.Blip_SetGlobal(BlipNativePointer, (value) ? (byte)1 : (byte)0);
80+
}
81+
}
7582
}
7683

77-
byte IBlip.BlipType { get; set; }
78-
7984
public bool IsAttached
8085
{
8186
get

0 commit comments

Comments
 (0)