Skip to content

Commit

Permalink
Temporary hack to fix T2/T3 for now. Basically just ignoring attempts…
Browse files Browse the repository at this point in the history
… to research

things that do not exist (instead of having lots of unreachable techs that do
nothing, which was the previous state). Remove duplicate script code for setting
amount of starting power; as a side effect starting power may be less now for
T2/T3. Will fix that later when scripts know the T2/T3 state. Closes ticket:3044
  • Loading branch information
perim committed Jan 14, 2012
1 parent e3534d1 commit c907d5a
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 40 deletions.
2 changes: 0 additions & 2 deletions data/base/multiplay/skirmish/rules.js
Expand Up @@ -20,8 +20,6 @@ function eventGameInit()
enableStructure("A0ResearchFacility", playnum);

// We need to enable these in order for scripts to be able to generate their templates.
// Cyborg legs is a research that is never researched. The rest are not even present in
// the research system. They should be there as results, along with the bodies.
makeComponentAvailable("CyborgLegs", playnum);
makeComponentAvailable("Cyb-Wpn-Atmiss", playnum);
makeComponentAvailable("CyborgCannon", playnum);
Expand Down
4 changes: 0 additions & 4 deletions data/mp/multiplay/script/cam2tech.vlo
Expand Up @@ -5,10 +5,6 @@ run
//ALWAYS MAKE THIS THE SAME AS THE INDEX OF THE LAST ENTRY IN THE camTech[] array
numCamTech int 115

initialPowerCl int 1000
initialPowerBa int 2000
initialPowerDe int 3000

camTech [0] RESEARCHSTAT "R-Comp-CommandTurret01"
camTech [1] RESEARCHSTAT "R-Comp-SynapticLink"
camTech [2] RESEARCHSTAT "R-Cyborg-Legs01"
Expand Down
6 changes: 1 addition & 5 deletions data/mp/multiplay/script/cam3tech.vlo
Expand Up @@ -3,13 +3,9 @@ run
{
//ALWAYS MAKE THIS THE SAME AS THE INDEX OF THE LAST ENTRY IN THE camTech[] array
numCamTech int 253
//ALWAYS MAKE THIS THE ONE MORE THAN THE INDEX OF THE LAST ENTRY IN THE camTech[] array
//ALWAYS MAKE THIS THE ONE MORE THAN THE INDEX OF THE LAST ENTRY IN THE camTechB[] array
numCamTechB int 17

initialPowerCl int 2000
initialPowerBa int 3000
initialPowerDe int 4000

// tech level three
camTech [0] RESEARCHSTAT "R-Wpn-RocketSlow-ROF03"

Expand Down
20 changes: 1 addition & 19 deletions data/mp/multiplay/script/camtech.slo
@@ -1,31 +1,13 @@
// technology auto enabler.

public int initialPowerCl, initialPowerBa, initialPowerDe, numCamTech, numCamTechB;
public int numCamTech, numCamTechB;
public RESEARCHSTAT camTech[254];
public RESEARCHSTAT camTechB[17];

event setTechPower(CALL_GAMEINIT)
{
local int playnum, count;

playnum = 0;
while (playnum < MAX_PLAYERS)
{
if(multiPlayerBaseType == CAMP_CLEAN)
{
setPowerLevel(initialPowerCl, playnum);
}
else if(multiPlayerBaseType == CAMP_BASE)
{
setPowerLevel(initialPowerBa, playnum);
}
else
{
setPowerLevel(initialPowerDe, playnum);
}
playnum = playnum + 1;
}

playnum = 0;
while (playnum < MAX_PLAYERS)
{
Expand Down
7 changes: 1 addition & 6 deletions src/research.cpp
Expand Up @@ -1726,12 +1726,7 @@ RESEARCH *getResearch(const char *pName)
return &asResearch[inc];
}
}

for (inc = 0; inc < asResearch.size(); inc++)
{
debug(LOG_ERROR, " Research %d: %s", inc, asResearch[inc].pName);
}
debug(LOG_ERROR, "Unknown research - %s", pName);
debug(LOG_WARNING, "Unknown research - %s", pName);
return NULL;
}

Expand Down
8 changes: 4 additions & 4 deletions src/scriptfuncs.cpp
Expand Up @@ -4249,11 +4249,11 @@ bool scrCompleteResearch(void)
return false;
}


if(psResearch == NULL)
if (psResearch == NULL)
{
ASSERT( false, "scrCompleteResearch: no such research topic" );
return false;
// hack to make T2 and T3 work even though the research lists
// are polluted with tons of non-existent techs :(
return true;
}

researchIndex = psResearch->index;
Expand Down
2 changes: 2 additions & 0 deletions src/scriptvals_parser.ypp
Expand Up @@ -706,11 +706,13 @@ var_init: var_entry TYPE var_value
YYABORT;
}
data.v.oval = getResearch($3.pString); /* store pointer */
#if 0
if (data.v.oval == NULL)
{
yyerror("Research %s not found", $3.pString);
YYABORT;
}
#endif
if(!eventSetContextVar(psCurrContext, $1, &data))
{
yyerror("Set Value Failed for %u", $1);
Expand Down

0 comments on commit c907d5a

Please sign in to comment.