ArkShop 1.9: ASA 92.28 compatibility and dino traits - #23
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the ArkShop plugin to version 1.9 for compatibility with ARK: Survival Ascended 92.28 (AsaApi 2.03) and introduces an optional random "dino traits" system for shop dino purchases. It also migrates several player-state checks and purchase actions away from now-changed AsaApi helpers to direct SDK field/method access, and hardens the engram/beacon purchase paths with point-refund-on-failure handling.
Changes:
- Adds a configurable
DinoTraitssystem (globalEnabled, tier weights, trait list) with a per-dinoGiveRandomTraitoverride, applied inGiveDino; auto-migrates existingconfig.jsonto include the new defaults. - Replaces
AsaApi::IApiUtilsdead/riding checks with localArkShop::IsPlayerDead/IsRidingDinohelpers, and updates the post-spawn controller lookup and the unconscious check for 92.28 compatibility. - Reworks engram unlock (
ServerUnlockEngram) and beacon summon (DoSummon) to detect failure and refund points, and bumps the plugin version to 1.9.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ArkShop/Configs/PluginInfo.json | Bumps plugin version 1.8 → 1.9. |
| ArkShop/Configs/config.json | Adds DinoTraits default block (enabled flag, tier weights, trait list). |
| ArkShop/Configs/Commented.json | Documents the new DinoTraits block and per-dino GiveRandomTrait override. |
| ArkShop/ArkShop/Private/Helpers.h | Adds IsPlayerDead/IsRidingDino inline helpers using SDK field access. |
| ArkShop/ArkShop/Private/ArkShop.h | Extends GiveDino signature with bool giveRandomTrait = false. |
| ArkShop/ArkShop/Private/ArkShop.cpp | Implements trait parsing/weighted selection, config migration, applies trait in GiveDino, updates unconscious check. |
| ArkShop/ArkShop/Private/Store.cpp | Migrates engram unlock/beacon summon to new SDK calls with refund-on-failure; uses new helpers. |
| ArkShop/ArkShop/Private/StoreSell.cpp | Uses local IsPlayerDead helper. |
| ArkShop/ArkShop/Private/Kits.cpp | Uses local IsPlayerDead helper; replaces post-spawn controller lookup with GetOwnerController. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Lethalinjectionx
left a comment
There was a problem hiding this comment.
This is no way this code can be accepted in its current form.
There was a problem hiding this comment.
Nearly 400 lines of code is not needed for this. Did copilot write this code because it doesn't seem care based on its review.
| FORCEINLINE bool IsPlayerDead(AShooterPlayerController* player_controller) | ||
| { | ||
| if (player_controller == nullptr) | ||
| return true; | ||
|
|
||
| AShooterCharacter* character = player_controller->BaseGetPlayerCharacter(); | ||
| return character == nullptr || character->bIsDead()(); | ||
| } | ||
|
|
||
| FORCEINLINE bool IsRidingDino(AShooterPlayerController* player_controller) | ||
| { | ||
| if (player_controller == nullptr) | ||
| return false; | ||
|
|
||
| AShooterCharacter* character = player_controller->BaseGetPlayerCharacter(); | ||
| return character != nullptr && character->bIsRiding()(); | ||
| } | ||
|
|
There was a problem hiding this comment.
Absolutely 0 reasons to pull these functions from the API headers they are already compiled inline and were already being used from the API Utils.
| bool CanUseKit(AShooterPlayerController* player_controller, const FString& eos_id, const FString& kit_name) | ||
| { | ||
| if (player_controller == nullptr || AsaApi::IApiUtils::IsPlayerDead(player_controller)) | ||
| if (ArkShop::IsPlayerDead(player_controller)) |
| void RedeemKit(AShooterPlayerController* player_controller, const FString& kit_name, bool should_log, bool from_spawn, int senderPlatform) | ||
| { | ||
| if (AsaApi::IApiUtils::IsPlayerDead(player_controller)) | ||
| if (ArkShop::IsPlayerDead(player_controller)) |
| void BuyKit(AShooterPlayerController* player_controller, FString* message, int, int senderPlatform) | ||
| { | ||
| if (AsaApi::IApiUtils::IsPlayerDead(player_controller)) | ||
| if (ArkShop::IsPlayerDead(player_controller)) |
| AShooterPlayerController* player = _this != nullptr | ||
| ? static_cast<AShooterPlayerController*>(_this->GetOwnerController()) | ||
| : nullptr; |
| bool Buy(AShooterPlayerController* player_controller, const FString& item_id, int amount) | ||
| { | ||
| if (AsaApi::IApiUtils::IsPlayerDead(player_controller)) | ||
| if (ArkShop::IsPlayerDead(player_controller)) |
| bool Sell(AShooterPlayerController* player_controller, const FString& item_id, int amount) | ||
| { | ||
| if (AsaApi::IApiUtils::IsPlayerDead(player_controller)) | ||
| if (ArkShop::IsPlayerDead(player_controller)) |
Summary
Testing