Die Sache mit dem last turn ist jetzt ordentlich gemacht, und vom turn im datenfile abhängig, nicht mehr davon, wie turn selbst gesetzt ist. Außerdem geht der lua-Kram jetzt auch, wenn ALLIANCES nicht defined ist, was wichtig ist wenn ich mal das reguläre Eressea umstellen sollte.

Und ein separates Projekt für Server mit und ohne lua gibt's für Visual Studio jetzt auch noch.
This commit is contained in:
Enno Rehling 2004-01-04 22:29:33 +00:00
parent a9d118f3ab
commit 14715f093e
12 changed files with 475 additions and 161 deletions

View File

@ -133,27 +133,7 @@ scramble(void *data, int n, size_t width)
memcpy((char*)data+k*width, temp, width);
}
}
#if 0
#define MAX 6
int oi[MAX];
void
test_scramble(void)
{
int i;
for (i=0;i!=MAX;++i) {
oi[i] = i;
}
scramble(oi, MAX, sizeof(int));
for (i=0;i!=MAX;++i) {
int j;
for (j=0;j!=MAX;++j) {
if (oi[j]==i) break;
}
assert(j!=MAX);
}
}
#endif
static void
expandorders(region * r, request * requests)
{
@ -190,15 +170,11 @@ expandorders(region * r, request * requests)
} else {
oa = NULL;
}
#if 0
freelist(requests);
#else
while (requests) {
request * o = requests->next;
free(requests);
requests = o;
}
#endif
}
/* ------------------------------------------------------------- */

View File

@ -1155,6 +1155,7 @@ typedef struct settings {
unsigned int maxunits;
struct attrib *attribs;
unsigned int data_version;
unsigned int data_turn;
boolean disabled[MAXKEYWORDS];
struct param * parameters;
} settings;

View File

@ -193,13 +193,11 @@ set_show_item(faction *f, item_t i)
a->data.v = (void*)olditemtype[i];
}
#ifdef NEW_STARTEQUIPMENT
static item * equipment;
void add_equipment(const item_type * itype, int number)
{
if (itype!=NULL) i_change(&equipment, itype, number);
}
#endif
void
give_starting_equipment(struct region *r, struct unit *u)

View File

@ -167,9 +167,7 @@ extern int read_race_reference(const struct race ** rp, FILE * F);
extern const char * raceprefix(const struct unit *u);
#ifdef NEW_STARTEQUIPMENT
extern void add_equipment(const struct item_type * itype, int number);
#endif
extern void give_starting_equipment(struct region *r, struct unit *u);
#ifdef __cplusplus

View File

@ -574,7 +574,7 @@ factionorders(void)
/* TODO: +1 ist ein Workaround, weil turn erst in process_orders
* incrementiert wird. */
f->lastorders = turn+1;
f->lastorders = global.data_turn+1;
} else
log_warning(("Befehle für die ungültige Partei %s\n", fid));
@ -894,7 +894,7 @@ readgame(const char * filename, int backup)
exit(-1);
}
#endif
turn = ri(F);
global.data_turn = turn = ri(F);
/* read_dynamictypes(); */
/* max_unique_id = */ ri(F);
nextborder = ri(F);

View File

@ -145,12 +145,30 @@
<File
RelativePath=".\alliance.c">
</File>
<File
RelativePath=".\arena.c">
</File>
<File
RelativePath=".\arena.h">
</File>
<File
RelativePath=".\dungeon.c">
</File>
<File
RelativePath=".\dungeon.h">
</File>
<File
RelativePath=".\gmcmd.c">
</File>
<File
RelativePath=".\infocmd.c">
</File>
<File
RelativePath=".\museum.c">
</File>
<File
RelativePath=".\museum.h">
</File>
<File
RelativePath=".\score.c">
</File>

View File

@ -60,54 +60,96 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util\util.vc
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea-lua", "eressea\eressea-lua.vcproj", "{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}"
ProjectSection(ProjectDependencies) = postProject
{C14E3D2B-8189-4570-A4E3-9010C873E4FD} = {C14E3D2B-8189-4570-A4E3-9010C873E4FD}
{79659D44-EC28-42B9-9475-6C0D62D0AAE0} = {79659D44-EC28-42B9-9475-6C0D62D0AAE0}
{EF495253-2EEC-4F83-B6C0-D651F88B2198} = {EF495253-2EEC-4F83-B6C0-D651F88B2198}
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4} = {1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}
{601CF164-F483-4DE7-8014-64BDD30680B5} = {601CF164-F483-4DE7-8014-64BDD30680B5}
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211} = {EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}
{0EE778AB-8445-40DB-8F65-6BE378A91B97} = {0EE778AB-8445-40DB-8F65-6BE378A91B97}
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3} = {330712B5-8B27-4B17-B3CF-7A02CC0F93C3}
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00} = {4C837BEC-A428-4287-84B3-8F8F9DE7FA00}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Profile = Profile
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Debug.ActiveCfg = Debug|Win32
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Debug.Build.0 = Debug|Win32
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Profile.ActiveCfg = Release|Win32
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Profile.Build.0 = Release|Win32
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Release.ActiveCfg = Release|Win32
{330712B5-8B27-4B17-B3CF-7A02CC0F93C3}.Release.Build.0 = Release|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Debug.ActiveCfg = Debug|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Debug.Build.0 = Debug|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Profile.ActiveCfg = Profile|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Profile.Build.0 = Profile|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Release.ActiveCfg = Release|Win32
{B859D542-781E-4647-BCAB-3FE5ED077366}.Release.Build.0 = Release|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Debug.ActiveCfg = Debug|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Debug.Build.0 = Debug|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Profile.ActiveCfg = Profile|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Profile.Build.0 = Profile|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Release.ActiveCfg = Release|Win32
{79659D44-EC28-42B9-9475-6C0D62D0AAE0}.Release.Build.0 = Release|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Debug.ActiveCfg = Debug|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Debug.Build.0 = Debug|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Profile.ActiveCfg = Debug|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Profile.Build.0 = Debug|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Release.ActiveCfg = Release|Win32
{C14E3D2B-8189-4570-A4E3-9010C873E4FD}.Release.Build.0 = Release|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Debug.ActiveCfg = Debug|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Debug.Build.0 = Debug|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Profile.ActiveCfg = Profile|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Profile.Build.0 = Profile|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Release.ActiveCfg = Release|Win32
{EDB0DE67-8215-4AF7-ACA1-F23CB11FF211}.Release.Build.0 = Release|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Debug.ActiveCfg = Debug|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Profile.ActiveCfg = Debug|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Profile.Build.0 = Debug|Win32
{17F83AAB-352D-4F68-ADA6-09F36D86826F}.Release.ActiveCfg = Release|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.ActiveCfg = Debug|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Debug.Build.0 = Debug|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Profile.ActiveCfg = Release|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Profile.Build.0 = Release|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Release.ActiveCfg = Release|Win32
{601CF164-F483-4DE7-8014-64BDD30680B5}.Release.Build.0 = Release|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Debug.ActiveCfg = Debug|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Debug.Build.0 = Debug|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Profile.ActiveCfg = Release|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Profile.Build.0 = Release|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Release.ActiveCfg = Release|Win32
{4C837BEC-A428-4287-84B3-8F8F9DE7FA00}.Release.Build.0 = Release|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Debug.ActiveCfg = Debug|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Debug.Build.0 = Debug|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Profile.ActiveCfg = Debug|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Profile.Build.0 = Debug|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Release.ActiveCfg = Release|Win32
{0EE778AB-8445-40DB-8F65-6BE378A91B97}.Release.Build.0 = Release|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Debug.ActiveCfg = Debug|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Debug.Build.0 = Debug|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Profile.ActiveCfg = Release|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Profile.Build.0 = Release|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Release.ActiveCfg = Release|Win32
{EF495253-2EEC-4F83-B6C0-D651F88B2198}.Release.Build.0 = Release|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Debug.ActiveCfg = Debug|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Debug.Build.0 = Debug|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Profile.ActiveCfg = Profile|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Profile.Build.0 = Profile|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Release.ActiveCfg = Release|Win32
{1D80D05F-BCF5-4971-8F06-D9581FD3B1F4}.Release.Build.0 = Release|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Debug.ActiveCfg = Debug|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Debug.Build.0 = Debug|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Profile.ActiveCfg = Profile|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Profile.Build.0 = Profile|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.ActiveCfg = Release|Win32
{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -0,0 +1,399 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="eressea-lua"
ProjectGUID="{749A2F7C-B9C3-4CEB-B1B2-1D4587E68719}"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
ImproveFloatingPointConsistency="TRUE"
AdditionalIncludeDirectories="../common/kernel,../common/gamecode,../common/util,../common,.."
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="TRUE"
DisableLanguageExtensions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Release/eressea-lua.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="4"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="luabind.lib lua50.lib lualib50.lib"
OutputFile=".\Release/eressea-lua.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Release/eressea-lua.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Release/eressea-lua.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Profile|Win32"
OutputDirectory=".\Profile"
IntermediateDirectory=".\Profile"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
ImproveFloatingPointConsistency="TRUE"
AdditionalIncludeDirectories="../common/kernel,../common/gamecode,../common/util,../common,.."
PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="4"
EnableFunctionLevelLinking="TRUE"
DisableLanguageExtensions="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\Profile/eressea-lua.pch"
AssemblerListingLocation=".\Profile/"
ObjectFile=".\Profile/"
ProgramDataBaseFileName=".\Profile/"
BrowseInformation="1"
WarningLevel="4"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
OutputFile=".\Profile/eressea-lua.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Profile/eressea-lua.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
ImproveFloatingPointConsistency="TRUE"
AdditionalIncludeDirectories="../common/kernel,../common/gamecode,../common/util,../common,.."
PreprocessorDefinitions="_CONSOLE,WIN32"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
DisableLanguageExtensions="FALSE"
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/eressea-lua.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="4"
SuppressStartupBanner="TRUE"
DebugInformationFormat="4"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="luabindd.lib lua50d.lib lualib50d.lib"
OutputFile=".\Debug/eressea-lua.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Debug/eressea-lua.pdb"
SubSystem="1"/>
<Tool
Name="VCMIDLTool"
TypeLibraryName=".\Debug/eressea-lua.tlb"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Text Files"
Filter="">
<File
RelativePath="..\commit.txt">
</File>
<File
RelativePath="..\header.txt">
</File>
<File
RelativePath="..\todo.txt">
</File>
</Filter>
<Filter
Name="bindings"
Filter="">
<File
RelativePath=".\lua\alliance.cpp">
</File>
<File
RelativePath=".\lua\bindings.h">
</File>
<File
RelativePath=".\lua\building.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\eressea.cpp">
</File>
<File
RelativePath=".\lua\faction.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\list.h">
</File>
<File
RelativePath=".\lua\region.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\ship.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\unit.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
</Filter>
<File
RelativePath=".\korrektur.c">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="TRUE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\korrektur.h">
</File>
<File
RelativePath=".\server.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath="..\common\settings-eressea.h">
</File>
<File
RelativePath="..\common\settings-tutorial.h">
</File>
<File
RelativePath="..\common\settings-vinyambar-3.h">
</File>
<File
RelativePath="..\common\settings-vinyambar-4.h">
</File>
<File
RelativePath="..\common\settings-vinyambar-classic.h">
</File>
<File
RelativePath="..\common\settings-vinyambar.h">
</File>
<File
RelativePath="..\common\settings-wdw.h">
</File>
<File
RelativePath="..\common\settings.h">
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -215,127 +215,6 @@
RelativePath="..\todo.txt">
</File>
</Filter>
<Filter
Name="bindings"
Filter="">
<File
RelativePath=".\lua\alliance.cpp">
</File>
<File
RelativePath=".\lua\bindings.h">
</File>
<File
RelativePath=".\lua\building.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\eressea.cpp">
</File>
<File
RelativePath=".\lua\faction.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\list.h">
</File>
<File
RelativePath=".\lua\region.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\ship.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
<File
RelativePath=".\lua\unit.cpp">
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Profile|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
</File>
</Filter>
<File
RelativePath=".\korrektur.c">
<FileConfiguration
@ -361,13 +240,7 @@
RelativePath=".\korrektur.h">
</File>
<File
RelativePath=".\server.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
DisableLanguageExtensions="FALSE"/>
</FileConfiguration>
RelativePath=".\main.c">
</File>
<File
RelativePath="..\common\settings-eressea.h">

View File

@ -1,5 +1,7 @@
#include <config.h>
#include <eressea.h>
#ifdef ALLIANCES
#include "list.h"
// kernel includes
@ -51,3 +53,4 @@ bind_alliance(lua_State * L)
.property("factions", &alliance_factions, return_stl_iterator)
];
}
#endif

View File

@ -5,7 +5,9 @@
// kernel includes
#include <kernel/faction.h>
#include <kernel/unit.h>
#include <modules/alliance.h>
#ifdef ALLIANCES
# include <modules/alliance.h>
#endif
// lua includes
#include <lua.hpp>
@ -43,6 +45,7 @@ faction_units(const faction& f)
return eressea::list<unit, unit, factionunit>(f.units);
}
#ifdef ALLIANCES
static void
faction_setalliance(faction& f, alliance * team)
{
@ -54,8 +57,7 @@ faction_getalliance(const faction& f)
{
return f.alliance;
}
#endif
void
bind_faction(lua_State * L)
@ -73,6 +75,8 @@ bind_faction(lua_State * L)
.def_readwrite("subscription", &faction::subscription)
.def_readwrite("lastturn", &faction::lastorders)
.property("units", &faction_units, return_stl_iterator)
#ifdef ALLIANCES
.property("alliance", &faction_getalliance, &faction_setalliance)
#endif
];
}

View File

@ -326,7 +326,9 @@ lua_init(void)
luaopen_io(luaState);
luabind::open(luaState);
bind_eressea(luaState);
#ifdef ALLIANCES
bind_alliance(luaState);
#endif
bind_region(luaState);
bind_faction(luaState);
bind_unit(luaState);