Commit Graph

2681 Commits

Author SHA1 Message Date
omegablast2002@yahoo.com
d2a96e69df few small items, first since card view are now correctly null'ed, i ran into a few cases while watching demo mode where the game would trigger a stop on the battle hint that uses card views, apon checking the card view would be null at the time. so added a condiational check to prevent the game from trying to alter a null'ed pointer.
2nd, added a block out for optimizedhand in demo mode, ie any time its cpu player vs cpu player, noticed demo was starting matches with no cards.

3rd, added a hackish workaround to allow Ai to get eff returns on abilities using the all(this) lord workaround to target the source. Ai was not getting any returns on these abilities. now basically if the ability is a lord && !target...lets calculate this as tho source == target....
2010-12-17 20:59:08 +00:00
solo81@web.de
f5aa68b330 Fixed Hell-Bent Raider. 2010-12-17 18:46:33 +00:00
omegablast2002@yahoo.com
681f4ddc0e recommiting this, some of my testing stuff snuck in last commit. 2010-12-16 22:23:44 +00:00
wrenczes@gmail.com
60078c34c7 Additional fix to go along with r2834 - the previous fix revealed an ugly interdependency between CardView and MTGCardInstance. Neither object owns the other, but they each have a pointer reference to each other, which is a recipe for disaster if not managed correctly. I had fixed half of the problem, where the status of a CardView being destroyed wasn't reflected in the MTGCardInstance; meanwhile, it introduced another problem where if the MTGCardInstance was destroyed first, the CardView would crash when trying to do the cleanup.
This is a classic example of why naked pointers suck!  The right way to fix an interdependency would be to have these objects hold onto weak references to each other. But that's way too big a change at this point in time, so I've added this ugly hack instead.

This will fix an intermittent crash when either accessing the library or exiting a match.
2010-12-16 21:17:18 +00:00
Xawotihs
02fcf48869 Fixed maemo zlib dependency 2010-12-16 20:11:07 +00:00
Xawotihs
eaeb9cc2a6 Fixed for issue 564. Now we do nothing if we use the "menu key" in the language selection menu. 2010-12-16 18:36:07 +00:00
omegablast2002@yahoo.com
4458e61b75 2 things, moved poison count wingame to the top with the life, there were cases where it wasnt respecting "cantlose" cards. and 2nd gave Ai *some* direction as to what to do with poison counters. i saw him place poison counters on himself to death in a single round...its was embarrassing. 2010-12-16 16:09:35 +00:00
techdragon.nguyen@gmail.com
84e4213615 fixed sizing issue. I keep forgetting array size calculation in C++ isn't just a property like in other languages. Sorry guys. 2010-12-16 14:13:09 +00:00
techdragon.nguyen@gmail.com
e600c34852 changed ints to size_t for psp compilation warnings. 2010-12-16 13:47:39 +00:00
techdragon.nguyen@gmail.com
afdeae6901 fixed some formatting issues.
changed conditional for lord and thises evaluation from hardcoded value to length of the array being evaluated.  This doesn't change current functionality, but minimizes code change if these arrays were ever to change in size.
2010-12-16 12:53:48 +00:00
techdragon.nguyen@gmail.com
038fef7742 issue 561
initialized deck stats number.  The value wasn't being initialized correctly and thus retained the last set of values for a given deck.
2010-12-16 12:50:01 +00:00
wrenczes@gmail.com
1cc516193e Sidecar fix to the CardView change: running the test suite revealed a few other places where bad assumptions were being made that an event's card view pointer was legitimate. Now they properly evaluate whether the view is null and adjust accordingly. 2010-12-16 09:41:14 +00:00
wrenczes@gmail.com
87909bed08 Fix for issue 550, heap crashed game in turn 6.
The core problem I fixed was in CardView's (missing) destructor - on construction, a CardView will set itself as a member of its parent CardInstance, so it stands to reason that when it's about to be destroyed, it should do the inverse and remove itself in the same fashion from its parent.   This explains why weird graphic glitches were seen when casting Animate Dead on cards in a graveyard - the position data it was trying to use was already deleted from memory (a cardview is deleted on cleanup at the end of a turn if it's gone to the graveyard), but no one nulled out the deleted card view reference from the instance, so we'd access invalid data.

Some peripheral changes in this checkin:  two helper functions in CardGui (GetCenterX, GetCenterY)  that are part of my navigation patch are included.  They're unused in the current code base, so this has zero impact. (I'm only checking them in as it's more work than it's worth to refactor them into a separate changelist.  The core of the nav patch requires my mods to Closest.cpp / CardSelector.cpp to have any effect.)  I also included a helper function in the debug routines to spit out hex pointer addresses in trace outputs, which I used to chase down this bug.
2010-12-16 09:32:42 +00:00
omegablast2002@yahoo.com
6c06544838 fixed 562 special lands not sending tap events. activatedability was over riding the reacttoclick of manaproducer...therefore not sending out the tapformana event.
Issue: 562
2010-12-15 19:29:30 +00:00
omegablast2002@yahoo.com
99266ebae4 corrected mikes ABSOLUTE fail attempt at a test. yes, im pissed off. RUN YOUR TEST IN SLOW MOTION PLEASE!!!! THANKS! 2010-12-15 19:26:22 +00:00
omegablast2002@yahoo.com
7682af893b fixed plummets mana cost, it was incorrectly {g} and should have been {g}{1} <---look mike..... 2010-12-15 19:24:53 +00:00
wagic.the.homebrew@gmail.com
6c9d2db493 Erwand
-adding tests for issue 562 and issue 563
2010-12-15 13:36:11 +00:00
wrenczes@gmail.com
5778fa7ba2 Fixed a reported crash with 'Throat Slitter' per this response on the public beta post:
http://wololo.net/forum/viewtopic.php?f=18&t=2486#p18701

Also fixed a typo in Thrull Surgeon's code that I just happened to notice while making this fix.
2010-12-15 07:57:51 +00:00
Xawotihs
eab131f8be [iOS] Fixed icon and targets in xcode project 2010-12-14 17:01:07 +00:00
techdragon.nguyen@gmail.com
fcefd6385b 2010-12-14 11:54:53 +00:00
techdragon.nguyen@gmail.com
cb29f47fe3 2010-12-14 11:54:44 +00:00
techdragon.nguyen@gmail.com
f4ec87dbb0 reverted previous change. 2010-12-14 11:45:43 +00:00
techdragon.nguyen@gmail.com
61011b8924 No code changes.
* removed extraneous braces for case statements.
* changed tabs to spaces.
2010-12-14 11:37:32 +00:00
omegablast2002@yahoo.com
b247a7e83c just a brace moved, in cases of all(this) the 2nd statement would overide the first one which checks if its an attacker or blocker. 2010-12-14 11:25:01 +00:00
omegablast2002@yahoo.com
91347b38d9 sorry had to add this too, aparently simply putting BLAH_GOOD/BLAH_BAD without actually comparing it to the suggestion from af always returns true... 2010-12-14 11:02:49 +00:00
omegablast2002@yahoo.com
cf8cb213cc pump granting needed to be a little more specific, it is not enough to simply tell the Ai if it is "good" it has to also know if its the controller of the creature. otherwise i witnessned it pump opponents creature. small change no huge impact except correcting the use of ai good effects on human player creatures. 2010-12-13 18:54:41 +00:00
techdragon.nguyen@gmail.com
2fdf538014 Added another test for 559 to verify cards like Halcyon Glaze works as specified.
Note this particular aspect of the "becomes" ability was not broken prior to the fix for 559.  This is a sanity check as it has nothing to do with color change. but tests ability changes due to "becomes" ability.

Issue: 559
2010-12-13 16:58:37 +00:00
omegablast2002@yahoo.com
448099825a just moved a bracket in ai STANDARD_LEVELUP. the 3 condiational was outside of the bracket, causing it to over ride previous. it should ALWAYS consider the "maxlevel" hint. 2010-12-13 14:58:24 +00:00
wagic.the.homebrew@gmail.com
1046ffac02 Erwan
- fix for issue 559 based on Mike's suggestions. The test suite passes
2010-12-13 13:59:07 +00:00
wagic.the.homebrew@gmail.com
19fe04b882 Erwan
- fix for issue 558 (compilation issues in release mode on most platforms)
2010-12-13 13:16:01 +00:00
omegablast2002@yahoo.com
64af4470e4 further improved "prevent" training on ai, while polishing off a Ai deck based on cleric i noticed it was using WAY too much prevent on a creature...sometimes 6 points or more then it should have been using...we only ever want to use *just* enough to survive. this way we can spread the love to the other creatures.
i hope to have a polished cleric Ai deck for release 14.1 within the next day or so. trying to include a couple decks that take adventage of all this great training.

hopefully i can get prevent working as good as equip does...the Ai deck i constructed called
"the kor" is almost an unbeatable white weenie deck.
2010-12-13 12:33:35 +00:00
omegablast2002@yahoo.com
3c0ac6b3f5 this one didnt work. sorry! 2010-12-13 01:26:54 +00:00
Xawotihs
69d652fdcc Upgraded maemo release files 2010-12-12 22:51:36 +00:00
omegablast2002@yahoo.com
a46596672b bug fix for something reported in the forums, becomes( and transforms( were not correctly giving creatures abilities...this is just because of a small overlooked issue, the string would read "flying)" instead of "flying" and was there for rejected by mikes new abilities hash. same with transforms( it would read ",flying" and reject it...just had to correct the "ends" and "begins" of those strings...mike you told me you tested this change when we got into it...shame on you! 2010-12-12 17:02:41 +00:00
solo81@web.de
e5754cbfb4 Fixed issue531. 2010-12-12 16:18:19 +00:00
Xawotihs
3cb652087d iOS frontend and XCode project 2010-12-12 15:58:47 +00:00
solo81@web.de
32d614e23b Fixed Baku Altar (activation cost). 2010-12-12 13:22:35 +00:00
solo81@web.de
b609fa2cb1 Fixed Energy Storm. 2010-12-12 11:51:52 +00:00
wrenczes@gmail.com
4d0296d628 Fixed issue 551, "this vector contains over 1 million members" crash.
Thanks to Mike for helping me with the repro & debug session on his machine.
2010-12-12 09:44:45 +00:00
techdragon.nguyen@gmail.com
fe75493ffa No code change. Reformat code 2010-12-11 22:42:48 +00:00
Xawotihs
b3650bcccf - deactivate testsuite if _DEBUG is not defined 2010-12-11 22:39:35 +00:00
Xawotihs
ce7f62cac3 - Qt project cleanup, in particulary removed testsuite and traces in
release.
2010-12-11 22:32:06 +00:00
solo81@web.de
e2440af09e Fixed Goblin Piledriver.
It had a typo in its abilities-line.
2010-12-11 17:35:56 +00:00
wagic.the.homebrew@gmail.com
6ea7eb2b87 Erwan
- fix for issue 292 . This fixes the classical theme, which had been broken by the initial fix for the final Saga glitch
2010-12-11 16:00:59 +00:00
omegablast2002@yahoo.com
c54de679d4 couple bug fixes, a slight refactor,
ok here goes, first, fixed a crash that would happen when ever a player would gain more then 2000 life or take more then 2000 damage...the buffer was becoming corrupted i imagine because it was too small, increasing it to 10 slots allowed players to successfully take massive amounts of damage, highest i bothered checking was about 35k gained/lost, no crash...

2nd, removed the and refactored cantcaster rule, moved it to stateEffects() and renamed stateeffects to better reflect what it will be handling,

removed sneak attack rule and moved it into stateeffects

the following ints have been converted into bool, 
all the cantcasters, canputlandsintoplay is becoming a bool, the amount of lands you can play is now handled by a new varible int landsPlayerCanStillPlay (this is for my ability additional lands increase in support on perminents coming after the release)

the changes to bools were for an obvious reason, they were all ints pretending to be bools, my varibles were confusing as you would often see code like this if(cantblahblah > 0)
which to another coder might not make any sense.

these varible ints were returning 0 as false and 1 as true...changed them all to bools, same goes for putlandsinplay int, in half the places it was being used as a bool, AND it was tracking the amount, when i was coding additional land ability, this made it impossible to maintain correct amounts without damaging the rest of the code.
as a bool, controlled by stateeffects, it can now be used correctly as a bool in all cases, and the stateEffects manages the switch on it to false if you no longer have any landsPlayerCanStillPlay left.

the refactor on cantcaster was also a bug fix, it was reported to me that cantcasters were not correctly working, sometimes ai or player would still be allowed to play a card with one in play, because of the old way i had it setup somecases of bothcantcaster were reseting the cantcast to 0, basically making the check do nothing.

it is now handled in stateeffects if you have one in play, then its true, if not then false...this returns very accurate tracking of the cards instantly instead of checking as cards enter or left play.

the "both" versions now have their own bools to avoid future conflicts with the single player cantcast...

added a case for the fancy moving text, some move to library effects were incorrectly returing fetch.
2010-12-10 20:51:50 +00:00
wrenczes@gmail.com
f894056e74 Fixed the order of initializers to make the psp warnings go away. (Stupid gcc, I don't understand why it cares about the order of initializers in the first place...) 2010-12-10 10:25:35 +00:00
wrenczes@gmail.com
4ac3c01cb0 Fixed the include guards. This had disabled the _CrtSetDbgFlag() call, so we were no longer detecting memory leaks in debug under Win32 when exiting the app. Ouch!
(Confirmed that the leak I just fixed was present & reported by the debugger with this change in place.)
2010-12-10 09:18:29 +00:00
wrenczes@gmail.com
4fd67bd1fd line endings -> Unix. No code changes here. 2010-12-10 08:38:09 +00:00
wrenczes@gmail.com
f8368d01c4 Found & fixed two memory leaks:
- computeActions would leak a ManaCost.  This was fairly minor.
- AIPlayer::SelectAbility had a major leak.  Basically, there's some code that pulls a random number for an efficiency check - if the action's efficiency value was below that random number, the action pointer was cleared, and none of the actions that were to be discarded would be deleted out of the rankings map.  I've switched out the rankings container to not contain action pointers, but real action objects, so regardless what kind of logic is implemented, the map will properly clear out its objects upon destruction.
2010-12-10 08:37:41 +00:00
Xawotihs
40c1ed074b Fixed Qt windows project and activated precompiled header 2010-12-09 21:21:55 +00:00