[#12532] `@cameraX` / `@cameraY` etc Always Returns Local Player's Camera Even for Non‑Local Players
本帖由 MDT GitHub 同步机器人自动整理。翻译与摘要由 AI 生成,仅供阅读参考。
自动翻译暂时不可用,以下内容为原始内容。
问题概要
未生成摘要。
内容
Platforms
Windows
Build
159.7
Issue
Description
The following logic code is expected to return the camera information of the target player, but it actually always returns the local player's camera – even when the player parameter is not the local player.
sensor result player @cameraXCause
On the client side, player.con is always null.
As a result, the fallback Core.camera.position.x is used – which belongs to the local player's camera, regardless of which player entity is passed.
Impact
This bug causes desynchronized visual behavior across clients.
Example
The following logic will cause buildings to appear disabled on all clients except the server and the player who is actually selected by the logic:
sensor dead @unit @dead
jump 3 notEqual dead 1
ubind @emanate
sensor x @unit @x
sensor cx @unit @cameraX
op sub cx cx 3
op lessThan k1 cx x
op add cx cx 6
op greaterThan k2 cx x
op land k k1 k2
op add i i 1
select i lessThan i @links i 0
getlink r i
control enabled r k 0 0 0Clients not selected → see the building as disabled (incorrect state).
Server & selected player → see the building as active (correct state).
If the disabled building is a turret, it may still fire on the server, leading to enemy units being inexplicably killed on those clients, while the turret appears inactive to them.
Visual Evidence
What unselected clients see:
<img width="1084" height="339" alt="Image" src="https://github.com/user-attachments/assets/1639c906-7cbd-44b3-b218-8b997119e7b0" />
What the selected client sees:
<img width="912" height="271" alt="Image" src="https://github.com/user-attachments/assets/5d0b5f10-0985-417e-a7bb-223387589ae4" />
Steps to reproduce
Open the save file in the server, and two clients join the server.
Mods used
None
Save file
(Crash) logs
No response
Submission
I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.
I have searched the closed and open issues to make sure that this problem has not already been reported.
I am not using Foo's Client.
This issue occurs with no mods enabled.
I have attached a valid save file.
原始信息
GitHub 编号:#12532
作者:Kaleinova
状态:closed
标签:bug
创建时间:2026-08-26 13:57:29 CST
<details> <summary>查看原文</summary>
Platforms
Windows
Build
159.7
Issue
Description
The following logic code is expected to return the camera information of the target player, but it actually always returns the local player's camera – even when the player parameter is not the local player.
sensor result player @cameraXCause
On the client side, player.con is always null.
As a result, the fallback Core.camera.position.x is used – which belongs to the local player's camera, regardless of which player entity is passed.
Impact
This bug causes desynchronized visual behavior across clients.
Example
The following logic will cause buildings to appear disabled on all clients except the server and the player who is actually selected by the logic:
sensor dead @unit @dead
jump 3 notEqual dead 1
ubind @emanate
sensor x @unit @x
sensor cx @unit @cameraX
op sub cx cx 3
op lessThan k1 cx x
op add cx cx 6
op greaterThan k2 cx x
op land k k1 k2
op add i i 1
select i lessThan i @links i 0
getlink r i
control enabled r k 0 0 0Clients not selected → see the building as disabled (incorrect state).
Server & selected player → see the building as active (correct state).
If the disabled building is a turret, it may still fire on the server, leading to enemy units being inexplicably killed on those clients, while the turret appears inactive to them.
Visual Evidence
What unselected clients see:
<img width="1084" height="339" alt="Image" src="https://github.com/user-attachments/assets/1639c906-7cbd-44b3-b218-8b997119e7b0" />
What the selected client sees:
<img width="912" height="271" alt="Image" src="https://github.com/user-attachments/assets/5d0b5f10-0985-417e-a7bb-223387589ae4" />
Steps to reproduce
Open the save file in the server, and two clients join the server.
Mods used
None
Save file
(Crash) logs
No response
Submission
I have updated to the latest release (https://github.com/Anuken/Mindustry/releases) to make sure my issue has not been fixed.
I have searched the closed and open issues to make sure that this problem has not already been reported.
I am not using Foo's Client.
This issue occurs with no mods enabled.
I have attached a valid save file.
</details>
来源:GitHub #12532