Codechange: Remove CCountedPtr.

This was originally generic and used by YAPF, but now it is used only by script objects.

CCountedPtr provided much more (untested) functionality than used.

ScriptObjectRef already exists for script objects and does the same thing, so use this instead.
This commit is contained in:
Peter Nelson
2024-10-16 00:16:43 +01:00
committed by Peter Nelson
parent d8029b1d84
commit 8360fab18a
18 changed files with 66 additions and 282 deletions

View File

@@ -44,7 +44,7 @@
/* static */ ScriptGoal::GoalID ScriptGoal::New(ScriptCompany::CompanyID company, Text *goal, GoalType type, SQInteger destination)
{
CCountedPtr<Text> counter(goal);
ScriptObjectRef counter(goal);
EnforceDeityMode(GOAL_INVALID);
EnforcePrecondition(GOAL_INVALID, goal != nullptr);
@@ -79,7 +79,7 @@
/* static */ bool ScriptGoal::SetText(GoalID goal_id, Text *goal)
{
CCountedPtr<Text> counter(goal);
ScriptObjectRef counter(goal);
EnforcePrecondition(false, IsValidGoal(goal_id));
EnforceDeityMode(false);
@@ -92,7 +92,7 @@
/* static */ bool ScriptGoal::SetProgress(GoalID goal_id, Text *progress)
{
CCountedPtr<Text> counter(progress);
ScriptObjectRef counter(progress);
EnforcePrecondition(false, IsValidGoal(goal_id));
EnforceDeityMode(false);
@@ -119,7 +119,7 @@
/* static */ bool ScriptGoal::DoQuestion(SQInteger uniqueid, uint32_t target, bool is_client, Text *question, QuestionType type, SQInteger buttons)
{
CCountedPtr<Text> counter(question);
ScriptObjectRef counter(question);
EnforceDeityMode(false);
EnforcePrecondition(false, question != nullptr);