Merge lp:~alocritani/widelands/bug585987 into lp:widelands

Proposed by Angelo Locritani
Status: Merged
Merged at revision: 6202
Proposed branch: lp:~alocritani/widelands/bug585987
Merge into: lp:widelands
Diff against target: 183 lines (+26/-3)
13 files modified
src/logic/warehouse.cc (+10/-2)
src/logic/warehouse.h (+4/-0)
tribes/atlanteans/headquarters/conf (+1/-0)
tribes/atlanteans/port/conf (+1/-0)
tribes/atlanteans/warehouse/conf (+1/-0)
tribes/barbarians/headquarters/conf (+1/-0)
tribes/barbarians/headquarters_interim/conf (+1/-0)
tribes/barbarians/port/conf (+1/-0)
tribes/barbarians/warehouse/conf (+1/-0)
tribes/empire/headquarters/conf (+1/-0)
tribes/empire/headquarters_shipwreck/conf (+2/-1)
tribes/empire/port/conf (+1/-0)
tribes/empire/warehouse/conf (+1/-0)
To merge this branch: bzr merge lp:~alocritani/widelands/bug585987
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+89525@code.launchpad.net

Description of the change

just a proposal: healing in warehouses and headquarters, not in training. Logic: when soldiers are idle, their health increases: while training they are "busy" doing other things so no healing.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

This will not suffice. The proper code will also need to be done to Warehouse class in the code. There is a comment in warehouse.cc somewhere.

review: Needs Fixing
Revision history for this message
Angelo Locritani (alocritani) wrote :

I added the healing logic to warehouses (thanks for the tip). I tested it and seems to work fine, so I hope I'm not missing anything.

Revision history for this message
SirVer (sirver) wrote :

Looks good to me. I am gonna merge this right away.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/logic/warehouse.cc'
--- src/logic/warehouse.cc 2011-11-30 21:38:37 +0000
+++ src/logic/warehouse.cc 2012-01-26 17:32:28 +0000
@@ -250,8 +250,10 @@
250 Tribe_Descr const & _tribe)250 Tribe_Descr const & _tribe)
251:251:
252 Building_Descr(_name, _descname, directory, prof, global_s, _tribe),252 Building_Descr(_name, _descname, directory, prof, global_s, _tribe),
253m_conquers (0)253m_conquers (0),
254m_heal_per_second(0)
254{255{
256 m_heal_per_second = global_s.get_safe_int("heal_per_second");
255 if257 if
256 ((m_conquers =258 ((m_conquers =
257 prof.get_safe_section("global").get_positive("conquers", 0)))259 prof.get_safe_section("global").get_positive("conquers", 0)))
@@ -639,6 +641,7 @@
639 if (m_incorporated_workers.count(ware)) {641 if (m_incorporated_workers.count(ware)) {
640 WorkerList & soldiers = m_incorporated_workers[ware];642 WorkerList & soldiers = m_incorporated_workers[ware];
641643
644 uint32_t total_heal = descr().get_heal_per_second();
642 // Do not use container_iterate, as we plan to erase some645 // Do not use container_iterate, as we plan to erase some
643 // of those guys646 // of those guys
644 for647 for
@@ -656,7 +659,12 @@
656 m_supply->remove_workers(ware, 1);659 m_supply->remove_workers(ware, 1);
657 continue;660 continue;
658 }661 }
659 // If warehouse can heal, this is the place to put it.662
663 if (soldier->get_current_hitpoints() < soldier->get_max_hitpoints()) {
664 soldier->heal(total_heal);
665 continue;
666 }
667
660 }668 }
661 }669 }
662 m_next_military_act = schedule_act(game, 1000);670 m_next_military_act = schedule_act(game, 1000);
663671
=== modified file 'src/logic/warehouse.h'
--- src/logic/warehouse.h 2011-11-30 21:38:37 +0000
+++ src/logic/warehouse.h 2012-01-26 17:32:28 +0000
@@ -55,8 +55,12 @@
5555
56 virtual uint32_t get_conquers() const {return m_conquers;}56 virtual uint32_t get_conquers() const {return m_conquers;}
5757
58 uint32_t get_heal_per_second () const throw () {
59 return m_heal_per_second;
60 }
58private:61private:
59 int32_t m_conquers;62 int32_t m_conquers;
63 uint32_t m_heal_per_second;
60};64};
6165
6266
6367
=== modified file 'tribes/atlanteans/headquarters/conf'
--- tribes/atlanteans/headquarters/conf 2009-12-31 18:36:51 +0000
+++ tribes/atlanteans/headquarters/conf 2012-01-26 17:32:28 +0000
@@ -2,6 +2,7 @@
2size=big2size=big
3buildable=no3buildable=no
4destructible=no4destructible=no
5heal_per_second=2
5conquers=96conquers=9
67
7[idle]8[idle]
89
=== modified file 'tribes/atlanteans/port/conf'
--- tribes/atlanteans/port/conf 2011-01-19 18:15:57 +0000
+++ tribes/atlanteans/port/conf 2012-01-26 17:32:28 +0000
@@ -1,5 +1,6 @@
1size=port1size=port
2conquers=52conquers=5
3heal_per_second=2
34
4[buildcost]5[buildcost]
5trunk=36trunk=3
67
=== modified file 'tribes/atlanteans/warehouse/conf'
--- tribes/atlanteans/warehouse/conf 2011-09-12 17:29:32 +0000
+++ tribes/atlanteans/warehouse/conf 2012-01-26 17:32:28 +0000
@@ -1,4 +1,5 @@
1size=medium1size=medium
2heal_per_second=2
23
3[buildcost]4[buildcost]
4trunk=25trunk=2
56
=== modified file 'tribes/barbarians/headquarters/conf'
--- tribes/barbarians/headquarters/conf 2010-11-23 19:33:08 +0000
+++ tribes/barbarians/headquarters/conf 2012-01-26 17:32:28 +0000
@@ -6,6 +6,7 @@
6size=big6size=big
7buildable=no7buildable=no
8destructible=no8destructible=no
9heal_per_second=2
9conquers=910conquers=9
1011
11[idle]12[idle]
1213
=== modified file 'tribes/barbarians/headquarters_interim/conf'
--- tribes/barbarians/headquarters_interim/conf 2011-09-12 17:29:32 +0000
+++ tribes/barbarians/headquarters_interim/conf 2012-01-26 17:32:28 +0000
@@ -4,6 +4,7 @@
4size=big4size=big
5buildable=no5buildable=no
6destructible=no6destructible=no
7heal_per_second=2
7conquers=98conquers=9
89
9[idle]10[idle]
1011
=== modified file 'tribes/barbarians/port/conf'
--- tribes/barbarians/port/conf 2011-12-15 23:09:47 +0000
+++ tribes/barbarians/port/conf 2012-01-26 17:32:28 +0000
@@ -1,5 +1,6 @@
1size=port1size=port
2conquers=52conquers=5
3heal_per_second=2
34
4[buildcost]5[buildcost]
5trunk=36trunk=3
67
=== modified file 'tribes/barbarians/warehouse/conf'
--- tribes/barbarians/warehouse/conf 2010-10-18 15:50:45 +0000
+++ tribes/barbarians/warehouse/conf 2012-01-26 17:32:28 +0000
@@ -1,4 +1,5 @@
1size=medium1size=medium
2heal_per_second=2
23
3[buildcost]4[buildcost]
4trunk=35trunk=3
56
=== modified file 'tribes/empire/headquarters/conf'
--- tribes/empire/headquarters/conf 2010-08-01 14:35:38 +0000
+++ tribes/empire/headquarters/conf 2012-01-26 17:32:28 +0000
@@ -2,6 +2,7 @@
2size=big2size=big
3buildable=no3buildable=no
4destructible=no4destructible=no
5heal_per_second=2
5conquers=96conquers=9
67
7[idle]8[idle]
89
=== modified file 'tribes/empire/headquarters_shipwreck/conf'
--- tribes/empire/headquarters_shipwreck/conf 2011-09-12 17:29:32 +0000
+++ tribes/empire/headquarters_shipwreck/conf 2012-01-26 17:32:28 +0000
@@ -2,10 +2,11 @@
2size=big2size=big
3buildable=no3buildable=no
4destructible=no4destructible=no
5heal_per_second=2
5conquers=96conquers=9
67
7[idle]8[idle]
8# sfx=0 ../../../sound/spoken/warehouse-bringitin9# sfx=0 ../../../sound/spoken/warehouse-bringitin
9pics=headquarters_shipwreck_i_??.png10pics=headquarters_shipwreck_i_??.png
10hotspot=93 4011hotspot=93 40
11playercolor=true
12\ No newline at end of file12\ No newline at end of file
13playercolor=true
1314
=== modified file 'tribes/empire/port/conf'
--- tribes/empire/port/conf 2011-12-15 23:09:47 +0000
+++ tribes/empire/port/conf 2012-01-26 17:32:28 +0000
@@ -1,5 +1,6 @@
1size=port1size=port
2conquers=52conquers=5
3heal_per_second=2
34
4[buildcost]5[buildcost]
5trunk=36trunk=3
67
=== modified file 'tribes/empire/warehouse/conf'
--- tribes/empire/warehouse/conf 2010-08-01 14:35:38 +0000
+++ tribes/empire/warehouse/conf 2012-01-26 17:32:28 +0000
@@ -1,4 +1,5 @@
1size=medium1size=medium
2heal_per_second=2
23
3[buildcost]4[buildcost]
4trunk=25trunk=2

Subscribers

People subscribed via source and target branches

to status/vote changes: