Skip to content

Commit

Permalink
Add missing research items causing crashes in campaign. Closes ticket…
Browse files Browse the repository at this point in the history
…:3977 and closes ticket:3974.
  • Loading branch information
perim committed Mar 11, 2013
1 parent c1b4cad commit 2753aaa
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 3 deletions.
11 changes: 11 additions & 0 deletions data/base/stats/research_cam1.ini
Expand Up @@ -19,6 +19,17 @@
;resultFunctions = <comma-separated list> ;resultFunctions = <comma-separated list>
;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>> ;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>>


[R-Vehicle-Prop-Tracks]
name = "Tracked Propulsion"
researchPoints = 2400
researchPower = 75
keyTopic = 1
msgName = RES_TRACK1
iconID = IMAGE_RES_DROIDTECH
statID = tracked01
requiredResearch = R-Sys-Engineering01,R-Vehicle-Prop-Halftracks
resultComponents = tracked01

[R-Vehicle-Prop-Hover] [R-Vehicle-Prop-Hover]
name = "Hover Propulsion" name = "Hover Propulsion"
researchPoints = 3600 researchPoints = 3600
Expand Down
10 changes: 10 additions & 0 deletions data/base/stats/research_cam2.ini
Expand Up @@ -19,6 +19,16 @@
;resultFunctions = <comma-separated list> ;resultFunctions = <comma-separated list>
;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>> ;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>>


[R-Wpn-Rocket01-LtAT]
name = "Lancer AT Rocket"
researchPoints = 3600
researchPower = 112
keyTopic = 0
msgName = RES_W_RK_LTAT1
iconID = IMAGE_RES_WEAPONTECH
statID = Rocket-LtA-T
resultComponents = Rocket-LtA-T,Rocket-VTOL-LtA-T

[R-Defense-HardcreteWall] [R-Defense-HardcreteWall]
name = "Hardcrete" name = "Hardcrete"
researchPoints = 600 researchPoints = 600
Expand Down
10 changes: 10 additions & 0 deletions data/base/stats/research_cam3.ini
Expand Up @@ -19,6 +19,16 @@
;resultFunctions = <comma-separated list> ;resultFunctions = <comma-separated list>
;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>> ;replacedComponents = <comma-separated list of items <oldComponentID:newComponentID>>


[R-Wpn-Rocket01-LtAT]
name = "Lancer AT Rocket"
researchPoints = 3600
researchPower = 112
keyTopic = 0
msgName = RES_W_RK_LTAT1
iconID = IMAGE_RES_WEAPONTECH
statID = Rocket-LtA-T
resultComponents = Rocket-LtA-T,Rocket-VTOL-LtA-T

[R-Defense-HardcreteWall] [R-Defense-HardcreteWall]
name = "Hardcrete" name = "Hardcrete"
researchPoints = 600 researchPoints = 600
Expand Down
2 changes: 2 additions & 0 deletions src/research.cpp
Expand Up @@ -1536,6 +1536,8 @@ bool enableResearch(RESEARCH *psResearch, UDWORD player)
{ {
UDWORD inc; UDWORD inc;


ASSERT_OR_RETURN(false, psResearch, "No such research topic");

inc = psResearch->index; inc = psResearch->index;
if (inc > asResearch.size()) if (inc > asResearch.size())
{ {
Expand Down
1 change: 1 addition & 0 deletions src/scriptfuncs.cpp
Expand Up @@ -3994,6 +3994,7 @@ bool scrEnableResearch(void)
} }


ASSERT_OR_RETURN(false, player >= 0 && player < MAX_PLAYERS, "Invalid player number"); ASSERT_OR_RETURN(false, player >= 0 && player < MAX_PLAYERS, "Invalid player number");
ASSERT_OR_RETURN(false, psResearch, "Research topic specified not found");


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

0 comments on commit 2753aaa

Please sign in to comment.