Sounds like two different issues here, unless you mixed up something..
ASQPlayer* Player;
void AddPlayerToActiveList(ASQPlayer* Player);
This is shadowing, which is generally bad practice because it creates ambiguity when reading code. While the compiler can determine which “Player” you are referring to based on scope (and based on whether you specify this->Player
or not), for a code reader it is more difficult.
These rules ensure the UE4/5 source code is more readable.
You can generally disable specific rules for your own code. In this case, either use PRAGMA_DISABLE_SHADOW_VARIABLE_WARNINGS
in your header file, or set ShadowVariableWarningLevel = WarningLevel.Off;
in your Build.cs.
UFUNCTION(BlueprintCallable)
void AddPlayerToActiveList(ASQPlayer* player);
UFUNCTION(BlueprintCallable)
void RemovePlayerFromActiveList(ASQPlayer* player);
UFUNCTION(BlueprintCallable)
void AddActionToActionQueue(ASQPlayer* player, ASQPlanet* planet, EBuildingTypes buildingType, int buildTime);
This is not shadowing, and should compile perfectly fine (both with and without UFUNCTION).
Unless of course you also have a variable “player” as class member… in which case back to first point.
In that case, a typical way to work around it would be :
ASQPlayer* Player;
UFUNCTION(BlueprintCallable)
void AddPlayerToActiveList(ASQPlayer* InPlayer);
UFUNCTION(BlueprintCallable)
void RemovePlayerFromActiveList(ASQPlayer* InPlayer);
UFUNCTION(BlueprintCallable)
void AddActionToActionQueue(ASQPlayer* InPlayer, ASQPlanet* planet, EBuildingTypes buildingType, int buildTime);