Skip to content

Commit

Permalink
Fixed player child entities using wrong identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkentim committed Feb 7, 2020
1 parent d381cc1 commit e0e1cd2
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES-SampSharp.Core.md
@@ -1,3 +1,6 @@
### 0.9.3
- No changes

### 0.9.2
- No changes

Expand Down
3 changes: 3 additions & 0 deletions CHANGES-SampSharp.Entities.md
@@ -1,3 +1,6 @@
### 0.9.3
- Fixed player- textdraws, labels and objects not working as intended

### 0.9.2
- Fixed exception thrown when trying to destroy all components twice (#333)
- Fixed dialog response not being handled if the dialog was shown as a response to another dialog
Expand Down
Expand Up @@ -35,7 +35,7 @@ public class NativePlayerObject : NativeComponent

protected override void OnInitializeComponent()
{
Id = Entity;
Id = Entity / SampLimits.MaxPlayers;
PlayerId = Parent;
}

Expand Down
Expand Up @@ -30,7 +30,7 @@ public class NativePlayerTextDraw : NativeComponent

protected override void OnInitializeComponent()
{
Id = Entity;
Id = Entity / SampLimits.MaxPlayers;
PlayerId = Parent;
}

Expand Down
Expand Up @@ -30,7 +30,7 @@ public class NativePlayerTextLabel : NativeComponent

protected override void OnInitializeComponent()
{
Id = Entity;
Id = Entity / SampLimits.MaxPlayers;
PlayerId = Parent;
}

Expand Down
12 changes: 12 additions & 0 deletions src/TestMode.Entities/Systems/TestSystem.cs
Expand Up @@ -33,6 +33,18 @@ public class TestSystem : ISystem
private TextDraw _welcome;
private GangZone _zone;

[PlayerCommand]
public void HelloPlayerCommand(Player player, IWorldService worldService)
{
var welcome = worldService.CreatePlayerTextDraw(player, new Vector2(100, 80), "Hello, Player");
welcome.Alignment = TextDrawAlignment.Left;
welcome.Font = TextDrawFont.Diploma;
welcome.Proportional = true;
welcome.LetterSize = new Vector2(1, 1.2f);
welcome.Show();
player.SendClientMessage("Show see msg now...");
}

[PlayerCommand]
public void EntityManagerBugCommand(Player player, IDialogService dialogService)
{
Expand Down

0 comments on commit e0e1cd2

Please sign in to comment.