[Fix] At least mission computer doesn't crash now, right?

This commit is contained in:
Allanis 2013-04-02 22:11:34 +01:00
parent 853a07cf19
commit 2233635cdc
3 changed files with 2 additions and 17 deletions

View File

@ -796,21 +796,6 @@ static void misn(void) {
300, MISSION_HEIGHT - BUTTON_WIDTH - 120, 0, 300, MISSION_HEIGHT - BUTTON_WIDTH - 120, 0,
"txtDesc", &gl_smallFont, &cBlack, NULL); "txtDesc", &gl_smallFont, &cBlack, NULL);
// List.
if(mission_ncomputer != 0) {
// There are missions.
misn_names = malloc(sizeof(char*)*mission_ncomputer);
for(i = 0; i < mission_ncomputer; i++)
misn_names[i] = strdup(mission_computer[i].title);
} else {
// No missions.
misn_names = malloc(sizeof(char*));
misn_names[0] = strdup("No Missions");
}
window_addList(secondary_wid, 20, -40,
300, MISSION_HEIGHT-60,
"lstMission", misn_names, mission_ncomputer, 0, misn_update);
misn_genList(1); misn_genList(1);
} }

View File

@ -136,7 +136,7 @@ static int misn_factions(lua_State* L) {
static int space_getPlanet(lua_State* L) { static int space_getPlanet(lua_State* L) {
(void)L; (void)L;
// TODO: Proper getPlanet implementation. // TODO: Proper getPlanet implementation.
lua_pushstring(L, "Arrakis"); lua_pushstring(L, "SaraCraft");
return 1; return 1;
} }

View File

@ -370,7 +370,7 @@ void window_modifyText(const unsigned int wid, char* name, char* newstring) {
Widget* wgt = window_getwgt(wid, name); Widget* wgt = window_getwgt(wid, name);
if(wgt->dat.txt.text) free(wgt->dat.txt.text); if(wgt->dat.txt.text) free(wgt->dat.txt.text);
wgt->dat.txt.text = strdup(newstring); //wgt->dat.txt.text = strdup(newstring);
} }
void window_modifyImage(const unsigned int wid, char* name, glTexture* image) { void window_modifyImage(const unsigned int wid, char* name, glTexture* image) {