Technical support > Mac
Re: campaign game fails to start in 24881 ** FOUND **
keybounce:
I'm seeing qtrue, not qfalse.
--- Code: ---R_LoadProgram: 'world' loaded.
R_LoadProgram: 'mesh' loaded.
R_LoadProgram: 'warp' loaded.
R_LoadProgram: 'world' loaded.
R_LoadProgram: 'mesh' loaded.
R_LoadProgram: 'warp' loaded.
------- input initialization -------
Reading symbols for shared libraries . done
0 possible joysticks
no joystick found.
----------- parse scripts ----------
Shared Client/Server Info loaded
...112 items parsed
... 32 damage types parsed
... 69 map definitions parsed
... 29 equipment definitions parsed
... 10 inventory definitions parsed
... 22 team definitions parsed
music change to van_theme (from PsymongN3)
executing autoexec.cfg
"version" is "UFO: Alien Invasion 2.3-dev Unknown Jun 26 2009 MacOSX DEBUG"
Reading symbols for shared libraries warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/work/libvorbis-1.2.0/lib/.libs/vorbisfile.o" - no debug information available for "vorbisfile.c".
. done
R_RegisterModelShort: Could not find: 'weapons/autocannon/autocannon'
CL_LanguageInit: language settings are stored in configuration: none
...using language: C
SDL_ttf version 2.0.9 - we need at least 2.0.7
...registering 10 fonts
127 static models loaded
====== UFO Initialized ======
Switch grab input off
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Change gametype to 'Campaign mode'
--- save subsystem initialization --
added base subsystem
added campaign subsystem
added hospital subsystem
added market subsystem
added research subsystem
added employee subsystem
added aliencont subsystem
added production subsystem
added aircraft subsystem
added messagesystem subsystem
added stats subsystem
added nations subsystem
added transfer subsystem
added alien base subsystem
added xvirate subsystem
added installation subsystem
added messageoptions subsystem
********************
ERROR: B_ParseBuildings: Could not find tech that provides building_aliencontainment2
********************
Breakpoint 1, debug () at src/common/common.c:213
213 }
(gdb) bt
#0 debug () at src/common/common.c:213
#1 0x001299b0 in Com_Error (code=1, fmt=0x2157c0 "B_ParseBuildings: Could not find tech that provides %s\n") at src/common/common.c:242
#2 0x00061fb4 in B_ParseBuildings (name=0x25f2f70 "building_aliencontainment2", text=0xbffff060, link=qtrue) at src/client/campaign/cp_base.c:1670
#3 0x000754cc in CL_ParseScriptSecond (type=0x25f2fb0 "building", name=0x25f2f70 "building_aliencontainment2", text=0xbffff060) at src/client/campaign/cp_parse.c:671
#4 0x00075898 in CL_ReadSinglePlayerData () at src/client/campaign/cp_parse.c:779
#5 0x00015ecc in GAME_CP_InitStartup () at src/client/cl_game_campaign.c:426
#6 0x000133e8 in GAME_SetMode (gametype=5) at src/client/cl_game.c:118
#7 0x000139f8 in GAME_SetMode_f () at src/client/cl_game.c:245
#8 0x0011a0b4 in Cmd_ExecuteString (text=0xbffff234 "game_setmode") at src/common/cmd.c:912
#9 0x001185a8 in Cbuf_Execute () at src/common/cmd.c:229
#10 0x00037ab8 in CL_SendCommand () at src/client/cl_main.c:892
#11 0x000382e8 in CL_Frame (now=156429, data=0x0) at src/client/cl_main.c:1066
#12 0x0012bbac in tick_timer (now=156429, data=0x18505a6c) at src/common/common.c:1049
#13 0x0012bfd0 in Qcommon_Frame () at src/common/common.c:1130
#14 0x001a0660 in main (argc=1, argv=0xbffff8a4) at src/ports/macosx/osx_main.m:142
Current language: auto; currently c
(gdb) up
#1 0x001299b0 in Com_Error (code=1, fmt=0x2157c0 "B_ParseBuildings: Could not find tech that provides %s\n") at src/common/common.c:242
242 debug();
(gdb) up
#2 0x00061fb4 in B_ParseBuildings (name=0x25f2f70 "building_aliencontainment2", text=0xbffff060, link=qtrue) at src/client/campaign/cp_base.c:1670
1670 Com_Error(ERR_DROP, "B_ParseBuildings: Could not find tech that provides %s\n", name);
(gdb) list
1665
1666 tech_link = RS_GetTechByProvided(name);
1667 if (tech_link)
1668 building->tech = tech_link;
1669 else if (building->visible)
1670 Com_Error(ERR_DROP, "B_ParseBuildings: Could not find tech that provides %s\n", name);
1671
1672 do {
1673 /* get the name type */
1674 token = Com_EParse(text, errhead, name);
(gdb) p building
$1 = (building_t *) 0x2c351f0
(gdb) p *building
$2 = {
idx = -1,
tpl = 0x2c351f0,
base = 0x0,
id = 0x1614f4cc "building_aliencontainment2",
name = 0x1614f52c "Alien Containment Facility",
image = 0x1614f58c "base/aliencont1",
mapPart = 0x0,
pedia = 0x1614f5cc "rs_building_aliencontainment",
needs = 0x0,
fixCosts = 0,
varCosts = 0,
level = 0,
timeStart = 0,
buildTime = 0,
buildingStatus = B_STATUS_NOT_SET,
visible = qtrue,
used = 0,
onConstruct = '\0' <repeats 63 times>,
onAttack = '\0' <repeats 63 times>,
onDestroy = '\0' <repeats 63 times>,
maxCount = -1,
pos = {0, 0},
mandatory = qfalse,
maxEmployees = 0,
buildingType = MAX_BUILDING_TYPE,
tech = 0x0,
dependsBuilding = 0x0,
capacity = 0
}
(gdb)
--- End code ---
What else should I look for ?
keybounce:
Found it.
You are writing an int value to a byte pointer.
It doesn't work right.
--- Code: ---(gdb) s
Com_EParseValueDebug (base=0x2c351f0, token=0x2746198 "false", type=V_BOOL, ofs=60, size=4, file=0x214608 "src/client/campaign/cp_base.c", line=1651) at src/common/scripts.c:539
539 const resultStatus_t result = Com_ParseValue(base, token, type, ofs, size, &writtenBytes);
(gdb) s
Com_ParseValue (base=0x2c351f0, token=0x2746198 "false", type=V_BOOL, ofs=60, size=4, writtenBytes=0xbfffef3c) at src/common/scripts.c:221
221 resultStatus_t status = RESULT_OK;
(gdb) # offset 60 ...
(gdb) n
222 b = (byte *) base + ofs;
(gdb)
223 *writtenBytes = 0;
(gdb) p *b
$46 = 0 '\0'
(gdb) p base
$47 = (void *) 0x2c351f0
(gdb) p building
No symbol "building" in current context.
(gdb) p (building_t *)base
$48 = (building_t *) 0x2c351f0
(gdb) p *$
$49 = {
idx = -1,
tpl = 0x2c351f0,
base = 0x0,
id = 0x18551f5c "building_aliencontainment2",
name = 0x18551fbc "Alien Containment Facility",
image = 0x1855214c "base/aliencont1",
mapPart = 0x0,
pedia = 0x1855201c "rs_building_aliencontainment",
needs = 0x0,
fixCosts = 0,
varCosts = 0,
level = 0,
timeStart = 0,
buildTime = 0,
buildingStatus = B_STATUS_NOT_SET,
visible = qtrue,
used = 0,
onConstruct = '\0' <repeats 63 times>,
onAttack = '\0' <repeats 63 times>,
onDestroy = '\0' <repeats 63 times>,
maxCount = -1,
pos = {0, 0},
mandatory = qfalse,
maxEmployees = 0,
buildingType = MAX_BUILDING_TYPE,
tech = 0x0,
dependsBuilding = 0x0,
capacity = 0
}
(gdb) p $->visible
$50 = qtrue
(gdb) p &$
$51 = (qboolean *) 0x2c3522c
(gdb) p b
$52 = (byte *) 0x2c3522c ""
(gdb) # correct location
(gdb) n
225 if (size) {
(gdb) p size
$53 = 4
(gdb) n
227 if (size > vt_sizes[type]) {
(gdb) p vt_sizes[type]
$54 = 4
(gdb) n
232 if (size < vt_sizes[type]) {
(gdb) n
238 switch (type) {
(gdb) p type
$55 = V_BOOL
(gdb) n
249 if (!strcmp(token, "true") || *token == '1')
(gdb) p token
$56 = 0x2746198 "false"
(gdb) n
251 else if (!strcmp(token, "false") || *token == '0')
(gdb) p b
$57 = (byte *) 0x2c3522c ""
(gdb) p *b
$58 = 0 '\0'
(gdb) p qtrue
$59 = qtrue
(gdb) p (int) qtrue
$60 = 1
(gdb) # wait ...
(gdb) p (building_t *)base
$61 = (building_t *) 0x2c351f0
(gdb) p $->visible
$62 = qtrue
(gdb) p (int) $->visible
Attempt to extract a component of a value that is not a structure pointer.
(gdb) p (int) $61->visible
$63 = 1
(gdb) p *b
$64 = 0 '\0'
(gdb) p $61->visible
$65 = qtrue
(gdb) p &$
$66 = (qboolean *) 0x2c3522c
(gdb) p b
$67 = (byte *) 0x2c3522c ""
(gdb) p *b
$68 = 0 '\0'
(gdb) p *(int *)b
$69 = 1
(gdb) n
252 *b = qfalse;
(gdb) p *(int *)b
$70 = 1
(gdb) n
251 else if (!strcmp(token, "false") || *token == '0')
(gdb) p *(int *)b
$71 = 1
(gdb) # bingo.
(gdb)
--- End code ---
keybounce:
Interestingly, everything else in that section has (int *) on the writes. Only bools don't.
keybounce:
and changing that to use (int *)'s makes the campaign game start. Yeah.
Mattn:
please submit a patch for this.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version