Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
476 stars 75 forks source link

[LUA] SetAI overrides name #1467

Open Spikeone opened 2 years ago

Spikeone commented 2 years ago

When using:

rttr:GetPlayer(1):SetName('some name')
rttr:GetPlayer(1):SetAI(3)

The AI name changes to the default name.

But using

rttr:GetPlayer(1):SetAI(3)
rttr:GetPlayer(1):SetName('some name')

Works as expected. So not sure if this a wanted behavior (which'd be okay for me, then this ticket is for clarification), or if the AI name should only change if no custom name was set.

Flamefire commented 2 years ago

As it is impossible to check where the previous name came from this is wanted behavior. I.e. switching to AI changes the name to the AIs default name Feel free to mention that in the docs, maybe at SetAI?

Spikeone commented 2 years ago

we should have a documentation label :<