Changeset 0e84f0aa43b80052e158e2c190490d811bd9395b
- Timestamp:
- 06/28/08 13:39:31
(3 months ago)
- Author:
- Christopher Jung <bktheg@web.de>
- git-committer:
- Christopher Jung <bktheg@web.de> 1214653171 +0200
- git-parent:
[be48d2fd82f54cc51efa1050eab48600c7dd91fa]
- git-author:
- Sebastian Gift <Madison@gt-knm.de> 1214653171 +0200
- Message:
[bug] Bugfix Warenankauf Handelsposten (Spieler kaufen vom Posten).
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re409332 |
r0e84f0a |
|
| 166 | 166 | } |
|---|
| 167 | 167 | totalRE += price; |
|---|
| | 168 | |
|---|
| | 169 | if(amountToBuy <= 0) { |
|---|
| | 170 | continue; |
|---|
| | 171 | } |
|---|
| | 172 | |
|---|
| 168 | 173 | moneyOfBuyer.subtract(BigInteger.valueOf(price)); |
|---|
| 169 | | |
|---|
| 170 | | assert amountToBuy >= 0: "AmountToBuy darf keine negative Zahl sein"; |
|---|
| 171 | | |
|---|
| 172 | | if(amountToBuy == 0) { |
|---|
| 173 | | continue; |
|---|
| 174 | | } |
|---|
| 175 | 174 | |
|---|
| 176 | 175 | this.posten.transfer(this.ship, resource.getId(), amountToBuy); |
|---|
| … | … | |
| 342 | 341 | SellLimit limit = (SellLimit)db.get(SellLimit.class, resourceLimitKey); |
|---|
| 343 | 342 | |
|---|
| | 343 | //Nicht kaeuflich |
|---|
| 344 | 344 | if(limit == null) { |
|---|
| 345 | 345 | continue; |
|---|
| 346 | 346 | } |
|---|
| | 347 | |
|---|
| | 348 | long buyable = this.posten.getCargo().getResourceCount(resource.getId()) - limit.getMinimum(); |
|---|
| | 349 | if(buyable <= 0) { |
|---|
| | 350 | continue; |
|---|
| | 351 | } |
|---|
| | 352 | |
|---|
| 347 | 353 | |
|---|
| 348 | 354 | t.setVar( "resbuy.img", resource.getImage(), |
|---|
| 349 | 355 | "resbuy.id", resource.getId(), |
|---|
| 350 | 356 | "resbuy.name", resource.getName(), |
|---|
| 351 | | "resbuy.cargo", this.posten.getCargo().getResourceCount(resource.getId()), |
|---|
| | 357 | "resbuy.cargo", buyable, |
|---|
| 352 | 358 | "resbuy.re", limit.getPrice() ); |
|---|
| 353 | 359 | t.parse("resbuy.list","resbuy.listitem",true); |
|---|