@@ -83,25 +83,25 @@
EnforcePrecondition(false, IsValidStoryPageElement(story_page_element_id));
StoryPageElement *pe = StoryPageElement::Get(story_page_element_id);
StoryPage *p = StoryPage::Get(pe->page);
::StoryPageElementType type = pe->type;
EnforcePrecondition(false, (type != ::SPET_TEXT && type != ::SPET_LOCATION) || (text != NULL && !StrEmpty(text->GetEncodedText())));
EnforcePrecondition(false, type != ::SPET_LOCATION || ::IsValidTile(reference));
EnforcePrecondition(false, type != ::SPET_GOAL || ScriptGoal::IsValidGoal((ScriptGoal::GoalID)reference));
EnforcePrecondition(false, type != ::SPET_GOAL || !(p->company == INVALID_COMPANY && Goal::Get(reference)->company != INVALID_COMPANY));
return ScriptObject::DoCommand(type == ::SPET_LOCATION ? reference : 0,
pe->page,
story_page_element_id,
type == ::SPET_GOAL ? reference : 0,
CMD_UPDATE_STORY_PAGE_ELEMENT,
type == ::SPET_TEXT || type == ::SPET_LOCATION ? text->GetEncodedText() : NULL,
&ScriptInstance::DoCommandReturnStoryPageElementID);
}
/* static */ bool ScriptStoryPage::SetTitle(StoryPageID story_page_id, Text *title)
{
CCountedPtr<Text> counter(title);
EnforcePrecondition(false, IsValidStoryPage(story_page_id));
EnforcePrecondition(false, ScriptObject::GetCompany() == OWNER_DEITY);
Status change: