Rename m_bobs to m_ship

Bug #1345733 reported by wl-zocker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

After https://code.launchpad.net/~wl-zocker/widelands/bug-1341662 will have been merged, the only bobs defined by a tribe are ships. All appearances of TribeDescr::m_bobs (only in src/logic/tribe.(cc|h)) should therefore be replaced by m_ship.

Related branches

SirVer (sirver)
Changed in widelands:
status: New → Confirmed
tags: added: lowhangingfruit
Changed in widelands:
importance: Undecided → Low
Revision history for this message
GunChleoc (gunchleoc) wrote :

I had a look at the code - m_bobs still contains animals for the gamekepper, although the bob descriptions themselves are now taken from the world. So, leave as is.

Changed in widelands:
assignee: nobody → GunChleoc (gunchleoc)
status: Confirmed → Invalid
Revision history for this message
SirVer (sirver) wrote :

Why do you think that? I cannot see this in the code. m_bobs is only add()ed to once and it is when the ship is parsed. The gamekeeper uses this only with world bobs now. Setting this back to confirmed - feel free to convince me otherwise :)

Changed in widelands:
status: Invalid → Confirmed
Revision history for this message
GunChleoc (gunchleoc) wrote :

From the Barbarian Gamekeeper conf:

program=release

[release]
0=setbobdescription wildboar stag sheep
<snip>
4=create_bob

The 3 bobs from setbobdescription must be registered with the tribe, otherwise the worker wouldn't know what to pick from with create_bob.

In the worker we have:

/**
 * Plants a bob (critter usually, maybe also worker later on). The immovable
 * type must have been selected by a previous command (i.e. setbobdescription).
 */
bool Worker::run_create_bob(Game & game, State & state, const Action &)

/**
 * setbobdescription \<bob name\> \<bob name\> ...
 *
 * Randomly select a bob name that can be used in subsequent commands
 * (e.g. create_bob).
 *
 * sparamv = possible bobs
 */
bool Worker::run_setbobdescription
 (Game & game, State & state, const Action & action)

Now we need to follow the trail to see where the Action gets the Critter from?

Revision history for this message
SirVer (sirver) wrote :

> The 3 bobs from setbobdescription must be registered with the tribe, otherwise the worker wouldn't know what to pick from with create_bob.

that is not correct. In fact, they are all searched for in the world.

I attached a branch that removed m_bobs and made it m_ship_descr. I do not think it is fit for merging yet - EditorGameBase.create_bob() can now be split into create_ship() and create_bob() that only creates world bobs. I added NOCOM in the code.

I am out of energy for today and this has a low priority - if somebody else wants to pick this up, go for it.

Changed in widelands:
status: Confirmed → In Progress
Revision history for this message
GunChleoc (gunchleoc) wrote :

I tried working on this, but I need some help. The compiler barfs as soon as I include ship.h in the editorgamebase. I tried changing Ship from struct to class, but that doesn't help either.

http://bazaar.launchpad.net/~widelands-dev/widelands/remove_bobs_in_tribe/revision/7160

Revision history for this message
SirVer (sirver) wrote :

The Problem is that there is a cyclic dependencies in the headers here. You can track that down by looking at the list of how headers where included and from which file and keeping in mind, that headers will only ever be included once in each .cc file.

editor_game_base.h includes ship.h and ship.h includes (indirectly) editor_game_base.h. I fixed it by moving a bunch of method definitions from .h files into the corresponding .cc file and removed unnecessary header includes. Now it should compile again.

Revision history for this message
GunChleoc (gunchleoc) wrote :

This has been fixed with the one_tribe branch.

Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
milestone: none → build19-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.