mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 10:30:28 +00:00
(svn r23646) -Fix [FS#4901]: rescan the Game Scripts when done downloading one.
This commit is contained in:
parent
0f8360eee9
commit
da8777d4e5
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
@ -144,6 +144,7 @@
|
|||||||
</DataExecutionPrevention>
|
</DataExecutionPrevention>
|
||||||
<TargetMachine>MachineX86</TargetMachine>
|
<TargetMachine>MachineX86</TargetMachine>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<Profile>true</Profile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
@ -243,6 +244,7 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<Profile>true</Profile>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
@ -695,7 +695,7 @@ void OnTick_Companies()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_next_competitor_start == 0) {
|
if (_next_competitor_start == 0) {
|
||||||
_next_competitor_start = AI::GetStartNextTime() * DAY_TICKS;
|
_next_competitor_start = 1; //AI::GetStartNextTime() * DAY_TICKS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) {
|
if (AI::CanStartNew() && _game_mode != GM_MENU && --_next_competitor_start == 0) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
/** @file dmusic.cpp Playing music via DirectMusic. */
|
/** @file dmusic.cpp Playing music via DirectMusic. */
|
||||||
|
|
||||||
#ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT
|
#ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT_2
|
||||||
|
|
||||||
#define INITGUID
|
#define INITGUID
|
||||||
#include "../stdafx.h"
|
#include "../stdafx.h"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "../window_func.h"
|
#include "../window_func.h"
|
||||||
#include "../error.h"
|
#include "../error.h"
|
||||||
#include "../ai/ai.hpp"
|
#include "../ai/ai.hpp"
|
||||||
|
#include "../game/game.hpp"
|
||||||
#include "../base_media_base.h"
|
#include "../base_media_base.h"
|
||||||
#include "../sortlist_type.h"
|
#include "../sortlist_type.h"
|
||||||
#include "../querystring_gui.h"
|
#include "../querystring_gui.h"
|
||||||
@ -130,6 +131,10 @@ public:
|
|||||||
case CONTENT_TYPE_AI_LIBRARY:
|
case CONTENT_TYPE_AI_LIBRARY:
|
||||||
/* AI::Rescan calls the scanner. */
|
/* AI::Rescan calls the scanner. */
|
||||||
break;
|
break;
|
||||||
|
case CONTENT_TYPE_GAME:
|
||||||
|
case CONTENT_TYPE_GAME_LIBRARY:
|
||||||
|
/* Game::Rescan calls the scanner. */
|
||||||
|
break;
|
||||||
|
|
||||||
case CONTENT_TYPE_BASE_GRAPHICS:
|
case CONTENT_TYPE_BASE_GRAPHICS:
|
||||||
case CONTENT_TYPE_BASE_SOUNDS:
|
case CONTENT_TYPE_BASE_SOUNDS:
|
||||||
@ -161,6 +166,11 @@ public:
|
|||||||
AI::Rescan();
|
AI::Rescan();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CONTENT_TYPE_GAME:
|
||||||
|
case CONTENT_TYPE_GAME_LIBRARY:
|
||||||
|
Game::Rescan();
|
||||||
|
break;
|
||||||
|
|
||||||
case CONTENT_TYPE_BASE_GRAPHICS:
|
case CONTENT_TYPE_BASE_GRAPHICS:
|
||||||
BaseGraphics::FindSets();
|
BaseGraphics::FindSets();
|
||||||
SetWindowDirty(WC_GAME_OPTIONS, WN_GAME_OPTIONS_GAME_OPTIONS);
|
SetWindowDirty(WC_GAME_OPTIONS, WN_GAME_OPTIONS_GAME_OPTIONS);
|
||||||
|
@ -818,13 +818,15 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
|
|||||||
sq_push(vm, 2);
|
sq_push(vm, 2);
|
||||||
|
|
||||||
for (ScriptListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) {
|
for (ScriptListMap::iterator iter = this->items.begin(); iter != this->items.end(); iter++) {
|
||||||
|
int key = (*iter).first;
|
||||||
|
|
||||||
/* Check for changing of items. */
|
/* Check for changing of items. */
|
||||||
int previous_modification_count = this->modifications;
|
int previous_modification_count = this->modifications;
|
||||||
|
|
||||||
/* Push the root table as instance object, this is what squirrel does for meta-functions. */
|
/* Push the root table as instance object, this is what squirrel does for meta-functions. */
|
||||||
sq_pushroottable(vm);
|
sq_pushroottable(vm);
|
||||||
/* Push all arguments for the valuator function. */
|
/* Push all arguments for the valuator function. */
|
||||||
sq_pushinteger(vm, (*iter).first);
|
sq_pushinteger(vm, key);
|
||||||
for (int i = 0; i < nparam - 1; i++) {
|
for (int i = 0; i < nparam - 1; i++) {
|
||||||
sq_push(vm, i + 3);
|
sq_push(vm, i + 3);
|
||||||
}
|
}
|
||||||
@ -868,7 +870,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
|
|||||||
return sq_throwerror(vm, _SC("modifying valuated list outside of valuator function"));
|
return sq_throwerror(vm, _SC("modifying valuated list outside of valuator function"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->SetValue((*iter).first, value);
|
this->SetValue(key, value);
|
||||||
|
|
||||||
/* Pop the return value. */
|
/* Pop the return value. */
|
||||||
sq_poptop(vm);
|
sq_poptop(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user