#gemrb@irc.freenode.net logs for 14 Jul 2012 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage


[00:35:38] --> nutron has joined #gemrb
[02:12:15] --> joneirik has joined #gemrb
[03:10:26] <-- wrotek has left IRC (Read error: Connection reset by peer)
[03:27:37] --> RadicalR has joined #gemrb
[03:29:33] <RadicalR> Hmmm, Annoying that GemRB gets a Dingoo release, but not a PSP release.
[04:00:04] <-- joneirik has left IRC (Quit: Get used to disappointment.)
[05:20:32] <-- RadicalR has left IRC (Read error: Connection reset by peer)
[05:20:56] --> RadicalR has joined #gemrb
[06:07:18] <-- nutron has left IRC (Quit: I must go eat my cheese!)
[07:04:54] --> nutron has joined #gemrb
[07:56:39] --> Adam007 has joined #gemrb
[08:02:32] --> lynxlynxlynx has joined #gemrb
[08:02:32] <-- lynxlynxlynx has left IRC (Changing host)
[08:02:32] --> lynxlynxlynx has joined #gemrb
[08:02:32] --- ChanServ gives channel operator status to lynxlynxlynx
[08:33:35] <lynxlynxlynx> RadicalR: http://forums.gibberlings3.net/index.php?s=0e43a903f6abeae9269c314d60472163&showtopic=21741
[08:33:52] <lynxlynxlynx> it's all about the deps and someone actually having the device and trying it out
[08:43:03] <Adam007> i think we still have nokia n9 in work ill try to make it work when i get back from vacation
[09:22:17] <lynxlynxlynx> n9 runs linux, doesn't it?
[09:22:40] <lynxlynxlynx> that shouldn't be a problem, the hardware is probably good enough too
[09:48:01] <CIA-31> GemRB: 03lynxlupodian * r2cce15727d88 10gemrb/gemrb/GUIScripts/LUSkillsSelection.py:
[09:48:01] <CIA-31> GemRB: luskills: fixed extraneus skill copy showing up due to index overflow
[09:48:01] <CIA-31> GemRB: can't believe this wasn't noticed since 2009!
[09:48:47] <lynxlynxlynx> maybe we capped it before the refactoring
[10:08:01] --> wrotek has joined #gemrb
[11:41:39] <-- Kiranos has left #gemrb
[11:53:00] --> kettuz has joined #gemrb
[12:19:05] <Adam007> n9 runs meago and it has also bash terminal out of box
[12:19:15] <Adam007> problem could be with packages
[12:56:58] <lynxlynxlynx> i doubt it
[12:57:17] <-- Drakkar has left IRC (Ping timeout: 265 seconds)
[13:17:19] --> Drakkar has joined #gemrb
[13:20:58] --> Yoshimo has joined #gemrb
[14:10:35] <Adam007> lynx I found another bug and fixed it
[14:10:41] <Adam007> how do i make patchfile?
[14:13:49] <lynxlynxlynx> you have a git checkout?
[14:13:56] <lynxlynxlynx> err clone
[14:14:43] <Adam007> oh i have it
[14:14:48] <Adam007> where can i paste result?
[14:14:54] <Adam007> i already made patchfile
[14:16:55] <Adam007> http://pastebin.com/EYYBXYkc
[14:17:02] <Adam007> its trivial but annoying ingame
[14:17:03] <Adam007> :)
[14:18:41] <Adam007> problem is without setting target to lucky roll, luck will always overflow dice
[14:18:49] <Adam007> so you allways get criticals
[14:22:59] <lynxlynxlynx> care to explain more?
[14:23:13] <Adam007> yes sure
[14:23:19] <lynxlynxlynx> also your patch would only help in the case the target also has a luck bonus
[14:23:29] <Adam007> yes
[14:23:47] <Adam007> atm luck bonus for my char is 187
[14:23:54] <Adam007> problem is when you add that value to current roll
[14:24:02] <Adam007> because it will always overflow attack dice of 20
[14:24:16] <lynxlynxlynx> but we cap it
[14:24:22] <lynxlynxlynx> the problem is you got it that hi
[14:24:34] <lynxlynxlynx> brb
[14:24:46] <Adam007> i dunno im just playing standard game and its that high for all my chars
[14:26:27] <Adam007> maybe luck param is type of byte? judging by that high value
[14:27:44] <Adam007> GemRB::Actor::LuckyRoll (this=0xa30ec0, dice=1, size=20, add=0, flags=1, opponent=0x0)
[14:27:44] <Adam007> at /home/adam/Projects/gemrb/gemrb/core/Scriptable/Actor.cpp:8192
[14:27:44] <Adam007> 8192 assert(this != opponent);
[14:27:44] <Adam007> (gdb) n
[14:27:44] <Adam007> 8196 luck = (signed) GetSafeStat(IE_LUCK);
[14:27:45] <Adam007> (gdb)
[14:27:47] <Adam007> 8199 if (flags&LR_DAMAGELUCK) {
[14:27:49] <Adam007> (gdb)
[14:27:51] <Adam007> 8204 if (opponent) luck -= opponent->GetSafeStat(IE_LUCK);
[14:27:53] <Adam007> (gdb)
[14:27:55] <Adam007> 8206 if (flags&LR_NEGATIVE) {
[14:27:57] <Adam007> (gdb)
[14:27:59] <Adam007> 8210 if (dice < 1 || size < 1) {
[14:28:01] <Adam007> (gdb)
[14:28:03] <Adam007> 8214 ieDword critical = flags&LR_CRITICAL;
[14:28:05] <Adam007> (gdb)
[14:28:07] <Adam007> 8216 if (dice > 100) {
[14:28:11] <Adam007> (gdb)
[14:28:13] <Adam007> 8231 int roll, result = 0, misses = 0, hits = 0;
[14:28:15] <Adam007> (gdb)
[14:28:17] <Adam007> 8232 for (int i = 0; i < dice; i++) {
[14:28:19] <Adam007> (gdb)
[14:28:21] <Adam007> 8233 roll = core->Roll(1, size, 0);
[14:28:23] <Adam007> (gdb) print roll
[14:28:25] <Adam007> $9 = 0
[14:28:27] <Adam007> (gdb) n
[14:28:29] <Adam007> 8234 if (roll == 1) {
[14:28:31] <Adam007> (gdb) print roll
[14:28:33] <Adam007> $10 = 3
[14:28:35] <Adam007> (gdb) n
[14:28:37] <Adam007> 8236 } else if (roll == size) {
[14:28:41] <Adam007> (gdb) print roll
[14:28:43] <Adam007> $11 = 3
[14:28:45] <Adam007> (gdb) print size
[14:28:47] <Adam007> $12 = 20
[14:28:49] <Adam007> (gdb) n
[14:28:51] <Adam007> 8239 roll += luck;
[14:28:53] <Adam007> (gdb) n
[14:28:55] <Adam007> 8240 if (roll > size) {
[14:28:57] <Adam007> (gdb) n
[14:28:59] <Adam007> 8241 roll = size;
[14:29:01] <Adam007> (gdb) print roll
[14:29:03] <Adam007> $13 = 195
[14:29:05] <Adam007> (gdb) n
[14:29:07] <Adam007> 8245 result += roll;
[14:29:11] <Adam007> (gdb) n
[14:32:37] <lynxlynxlynx> the default luck is 0
[14:32:49] <lynxlynxlynx> and there's not many things that can change it drastically
[14:33:00] <Adam007> well im running vannila gemrb from git
[14:33:16] <lynxlynxlynx> only one thing can have such a huge effect and it is fatigue
[14:33:25] <lynxlynxlynx> but this would mean it overflowed
[14:33:43] <Adam007> well it happens even when im not fatigues
[14:33:46] <Adam007> fatigued
[14:33:58] <Adam007> maybe it overflows with first fatigue state?
[14:34:24] <lynxlynxlynx> i added safeguards, but apparently not enough
[14:34:38] <Adam007> atm i can confirm 2 of my chars have luck > 170
[14:34:39] <lynxlynxlynx> the code is in pcf_fatigue
[14:34:48] <lynxlynxlynx> pcf - post change function
[14:34:54] <lynxlynxlynx> these are run after stats change
[14:34:59] <lynxlynxlynx> in this case ie_fatigue
[14:35:34] <Adam007> actor.cpp right?
[14:35:42] <lynxlynxlynx> http://iesdp.gibberlings3.net/files/2da/2da_tob/fatigmod.htm <-- and this is the relevant table
[14:37:05] <lynxlynxlynx> fatigue is added every few hours
[14:37:11] <lynxlynxlynx> incremented, i mean
[14:37:27] <Adam007> isnt that a bit too much? -94 modifier to attack/roll? or is it percentage?
[14:37:34] <lynxlynxlynx> but there's also the constitution bonus which complicates the matter
[14:37:48] <lynxlynxlynx> it would gimp you completely, yes
[14:37:57] <Adam007> so %
[14:38:12] <lynxlynxlynx> but you get fatigued at 7 already, so i can't imagine anyone reaching that low
[14:39:00] <lynxlynxlynx> 1 point per 4h
[14:39:16] <lynxlynxlynx> haste and restoration can add some too
[14:39:51] <lynxlynxlynx> but i doubt anyone ever reached anything higher than lets say 20
[14:39:53] <Adam007> yes but i mean the luck modifier is a % modifier not value modifier right?
[14:40:11] <lynxlynxlynx> no
[14:41:19] <Adam007> that means you can get -90 to damage if you are fatigues?
[14:41:26] <Adam007> fatigued even
[14:41:28] <lynxlynxlynx> even if we forget what we know about it, the fact that the default luck is 0 would mean this penalty would never have an effect if it was a percentage
[14:41:46] <lynxlynxlynx> the rolls are capped at the minimum
[14:42:50] <Adam007> i know they are capped but having such a range for luck modifier means dice20 will overflow
[14:43:38] <Adam007> because of roll += luck; in Actor::LuckyRoll
[14:43:42] <lynxlynxlynx> they're capped on both ends
[14:43:49] <lynxlynxlynx> in the very next few lines
[14:44:02] <Adam007> yes but that means you can get only critical miss or critical hit
[14:44:10] <Adam007> with fatigue of 27
[14:44:14] <Adam007> or higher
[14:44:27] <lynxlynxlynx> yep
[14:44:38] <lynxlynxlynx> that's how they made it
[14:44:42] <Adam007> oh
[14:44:51] <lynxlynxlynx> but like i said, it's surreal to have so high fatigue
[14:45:17] <Adam007> is fatigue restored by resting in city on street?
[14:45:34] <lynxlynxlynx> of course
[14:45:56] <lynxlynxlynx> we have a bug in this luck handling somewhere
[14:46:14] <Adam007> i will rest my chars several times and see if luck is changed somehow
[14:47:06] <lynxlynxlynx> probably in the pcf, i can't imagine any other place
[14:47:23] <lynxlynxlynx> if the old value is 0, then there is no compensation
[14:55:34] <Adam007> with fully rested luck is 196
[14:56:54] <lynxlynxlynx> it's too late now anyway
[14:57:09] <lynxlynxlynx> it sets the base stat, not the modified one
[14:57:21] <lynxlynxlynx> meaning it is permanent
[14:58:10] <lynxlynxlynx> the thing to do is find out when the fatigue pcf misbehaves and increases the luck so much
[15:00:38] <Adam007> Im looking at pcf_fatigue atm, so fatigue is only way luck can be changed?
[15:01:15] <lynxlynxlynx> this drastically, yes
[15:01:40] <lynxlynxlynx> the luck spell adds 4 i think, non cummulative
[15:01:53] <lynxlynxlynx> some items +1
[15:02:01] <lynxlynxlynx> so yeah, irrelevant
[15:02:48] <Adam007> and from programming side pcf_fatigue is only function modifying luck?
[15:03:13] <Adam007> except from constructors
[15:03:28] <lynxlynxlynx> no, just grep for it
[15:03:46] <lynxlynxlynx> alias ggn='git grep -n' # this can be handy
[15:05:42] <Adam007> indeed, thanks
[15:08:09] <lynxlynxlynx> i added an assert in there, will go play a bit
[15:15:36] <Adam007> well it seems normal when Im iddlyig in town
[15:15:43] <Adam007> fatigue is <5,10>
[15:15:45] <Adam007> on all my chars
[15:16:46] <Adam007> Breakpoint 2, GemRB::pcf_fatigue (actor=0xa6e1b0, oldValue=4294967295, newValue=0)
[15:16:46] <Adam007> at /home/adam/Projects/gemrb/gemrb/core/Scriptable/Actor.cpp:1180
[15:16:53] <Adam007> Jaheira
[15:17:09] <Adam007> after resting in town
[15:17:30] <Adam007> same for all my chars oldvalue is waay to big
[15:19:00] <lynxlynxlynx> it's negative
[15:19:22] <Adam007> oldvalue is
[15:19:25] <Adam007> dunno why
[15:19:34] <Adam007> during combat pcf_fatigue doesnt get called
[15:19:39] <Adam007> so it must be something else
[15:19:51] <lynxlynxlynx> it's called when the stat changes
[15:19:59] <lynxlynxlynx> you went to sleep, so it's natural
[15:20:03] <Adam007> yes
[15:20:07] <lynxlynxlynx> i hit the opposite: #3 0x00007ffff7b2c6e1 in GemRB::pcf_fatigue (actor=0xb95100, oldValue=12, newValue=4294967295)
[15:20:09] <Adam007> but the value is out of bounds
[15:20:16] <Adam007> hmm
[15:20:36] <Adam007> i didnt check the function step by step only input values
[15:21:47] <lynxlynxlynx> fatigue itself should never be negative
[15:22:18] <Adam007> Breakpoint 2, GemRB::pcf_fatigue (actor=0x3c7eb60, oldValue=100, newValue=4294967295)
[15:22:28] <lynxlynxlynx> my problem is due to the constitution bonus
[15:23:12] <lynxlynxlynx> aha
[15:23:49] <lynxlynxlynx> not sure how to handle this properly
[15:24:01] <lynxlynxlynx> on a full rest, your fatigue is reset to 0
[15:24:16] <lynxlynxlynx> but with high constitution, you get a bonus, since you tire less often
[15:24:23] <lynxlynxlynx> so mine set it to -1
[15:24:57] <lynxlynxlynx> silly design, why didn't they make it decrease over time :)
[15:25:17] <Adam007> well not intuitive as well as Thaco and ac
[15:25:36] <Adam007> do you think this function sets the incorrect value or it is just called with incorrect input data?
[15:27:26] <Adam007> luckMod = core->ResolveStatBonus(actor, "fatigue") - luckMod;
[15:27:43] <lynxlynxlynx> in my case, i don't think a negative number is a problem, we just shouldn't touch luck
[15:28:04] <Adam007> why does that decrease fatigue of actor by luckMod?
[15:28:05] <lynxlynxlynx> your case just comes after that
[15:28:29] <lynxlynxlynx> does it?
[15:28:43] <Adam007> well it gets new value for luckMod
[15:30:39] <Adam007> oh it doesnt not set luck mod it just adds or substracts to that modifier
[15:31:20] <Adam007> wouldnt it be easier to add/subtract fatigue and then set luck from table?
[15:36:08] <lynxlynxlynx> we need to apply only the relative change to luck, since other permanent effects may affect it and they'd get removed/reset
[15:39:31] <Adam007> i cant find value for IE_LUCK
[15:39:53] <Adam007> oh 32
[15:45:59] <Adam007> this is strange
[15:46:00] <Adam007> Breakpoint 2, GemRB::pcf_fatigue (actor=0xdffc40, oldValue=4294967295, newValue=0)
[15:46:00] <Adam007> at /home/adam/Projects/gemrb/gemrb/core/Scriptable/Actor.cpp:1180
[15:46:00] <Adam007> 1180 int luckMod = core->ResolveStatBonus(actor, "fatigue", 1, oldValue);
[15:46:00] <Adam007> (gdb) n
[15:46:00] <Adam007> 1181 actor->BaseStats[IE_FATIGUE] = newValue;
[15:46:02] <Adam007> (gdb) print actor.BaseStats[32]
[15:46:04] <Adam007> $23 = 94
[15:46:06] <Adam007> (gdb) n
[15:46:08] <Adam007> 1183 luckMod = core->ResolveStatBonus(actor, "fatigue") - luckMod;
[15:46:10] <Adam007> (gdb) print actor.BaseStats[32]
[15:46:12] <Adam007> $24 = 94
[15:46:14] <Adam007> (gdb)
[15:46:33] <Adam007> oh nothing
[15:46:37] <Adam007> i was lucking for wrong define
[15:47:23] <lynxlynxlynx> uhh, there's more bugs in here than i thought
[15:47:42] <lynxlynxlynx> the hours during sleep also make you tired
[17:07:58] <RadicalR> In theory, if one were to attempt a port to the PSP, how much RAM is needed to undertake such a task?
[17:14:59] <lynxlynxlynx> all of it
[17:15:29] <RadicalR> 32 megs?
[17:15:48] <lynxlynxlynx> no way
[17:16:19] <lynxlynxlynx> 64 neither, without some work on gemrb first
[17:16:46] <RadicalR> Not 64 megs either?
[17:16:59] <RadicalR> How the hell did the guy port GemRB onto the Dingoo..?
[17:17:35] <lynxlynxlynx> that one only has 64? good news then :)
[17:17:51] <RadicalR> Yep.
[17:18:00] <lynxlynxlynx> i remember it has a terribly small screen, so he added a downscaler
[17:18:18] <RadicalR> Oh
[17:18:25] <RadicalR> Dingoo has 32 MB of Ram
[17:19:43] <lynxlynxlynx> loading times are horrible on such hw
[17:19:56] <lynxlynxlynx> it's painful to watch the video
[17:20:15] <lynxlynxlynx> a few console buttons instead of a mouse and keyboard? :S
[17:20:44] <RadicalR> Some of us don't have the luxury of hours on the computers.
[17:21:18] <Adam007> PSP doesnt have touch screen right?
[17:21:22] <RadicalR> Putting it on a portable device works.
[17:21:24] <RadicalR> Correct.
[17:21:28] <RadicalR> But neither does the Dingoo.
[17:21:46] <RadicalR> Also, you'll have access to more RAM on the PSP
[17:21:51] <RadicalR> So loading times shouldn't be AS bad.
[17:25:12] <lynxlynxlynx> the games are unplayable on dingoo
[17:25:41] <lynxlynxlynx> even on phones it can be a struggle and they're powerhouses in comparison
[17:27:01] <RadicalR> Hm - it would be an interesting test to see though.
[17:27:12] <RadicalR> I'll have to do some research I guess.
[17:27:21] <lynxlynxlynx> sure, i'm not trying to discourage you
[17:27:41] <lynxlynxlynx> the remaining dingux code should be here: https://github.com/SiENcE/gemrb
[17:27:42] <RadicalR> Bah, you're doing a good job at it :)
[17:27:54] <lynxlynxlynx> for example the downscaler wasn't merged
[17:29:19] <lynxlynxlynx> i can't pull an actual diff out of it right now
[17:34:34] <Adam007> any luck with fatigue lynx? :)
[17:35:14] <lynxlynxlynx> only partial
[17:49:26] --> kingron has joined #gemrb
[17:59:29] <Adam007> from my observation it happens after first sleep is initiated
[18:02:01] <Adam007> #3 0x00007ffff7b4253b in GemRB::Actor::Rest (this=0xb8daf0, hours=8)
[18:02:01] <Adam007> at /home/adam/Projects/gemrb/gemrb/core/Scriptable/Actor.cpp:7164
[18:02:01] <Adam007> 7164 SetBase (IE_FATIGUE, fatigueBonus);
[18:02:01] <Adam007> (gdb) print fatigueBonus
[18:02:01] <Adam007> $4 = -1
[18:02:11] <Adam007> #2 0x00007ffff7b3404f in GemRB::Actor::SetBase (this=0xb8daf0, StatIndex=30, Value=4294967295)
[18:02:11] <Adam007> at /home/adam/Projects/gemrb/gemrb/core/Scriptable/Actor.cpp:2439
[18:02:11] <Adam007> 2439 SetStat (StatIndex, Value+diff, InternalFlags&IF_INITIALIZED);
[18:02:11] <Adam007> (gdb) print diff
[18:02:11] <Adam007> $2 = 0
[18:02:13] <Adam007> (gdb) print Value
[18:02:15] <Adam007> $3 = 4294967295
[18:02:19] <Adam007> SetBase(unsigned int, unsigned int)
[18:02:23] <Adam007> unsigned int
[18:02:44] <Adam007> SetBase gets called with arg -1 but its converted to unsigned
[18:03:00] <Adam007> so it pups up as $3 = 4294967295
[18:03:03] <Adam007> what do you think?
[18:04:25] <Adam007> lynx :D
[18:08:11] <lynxlynxlynx> yes, that's the constitution bonus
[18:24:08] <Adam007> int fatigueBonus
[18:24:35] <Adam007> i dont know what ieDword is
[18:24:44] <Adam007> but its probably unsigned
[18:25:13] <lynxlynxlynx> yes
[18:26:06] <lynxlynxlynx> if you want to lose most of the problems, add this right after luckmod is set first: actor->BaseStats[IE_FATIGUE] = (int)newValue > 0 ? newValue : 0;
[18:30:57] <Adam007> isnt that a hack rather than a solution? :)
[18:35:46] <lynxlynxlynx> the whole ordeal is a hack, but i can't think of any nicer ways of handling it
[18:36:28] <lynxlynxlynx> without making direct access to the stat give skewed results, affecting guiscripts
[18:54:45] <lynxlynxlynx> oh and it's even more convoluted to work to this degree at all
[18:54:55] <lynxlynxlynx> since it is inside the stat update loop
[18:55:26] <Adam007> what is the problem? isnt it just type conversion?
[18:55:38] <lynxlynxlynx> no
[18:56:01] <lynxlynxlynx> stats can be negative just fine
[18:56:29] <lynxlynxlynx> luck is capped at 200, that's why you see values around that when something goes wrong
[18:57:13] <Adam007> yes but SetBase gets called with arg -1 and when you enter it arg is converted to unsigned and thats what causes huge values
[18:58:10] <Adam007> capping it doesnt solve the problem of type conversion
[18:59:40] <lynxlynxlynx> sure, but the stat is used signed
[19:00:35] <Adam007> SetBase(unsigned int, unsigned int) its defined as unsigned
[19:00:54] <Adam007> and Actor::Rest calls it with parameter -1
[19:01:12] <Adam007> <Adam007> 7164 SetBase (IE_FATIGUE, fatigueBonus);
[19:01:12] <Adam007> <Adam007> (gdb) print fatigueBonus
[19:01:12] <Adam007> <Adam007> $4 = -1
[19:01:29] <Adam007> and function itself works with unsigned input arguments
[19:01:48] <Adam007> so when it starts it converts fatigueBonus to 4000000 etc
[19:01:54] <lynxlynxlynx> yes, but nothing gets lost in the conversion
[19:02:09] <lynxlynxlynx> it doesn't go below half of the max to be ambiguous
[19:04:20] <Adam007> well then you should change type to unsigned in pcf_fatigue
[19:04:56] <Adam007> hmm
[19:05:25] <Adam007> actually i might be terribly wrong with this
[19:06:02] <Adam007> in pcf_fatigue actor->BaseStats[IE_FATIGUE] = newValue; should be actor->BaseStats[IE_FATIGUE] = (unsigned int) newValue;
[19:06:04] <Adam007> pehaps?
[19:06:08] <Adam007> perhaps
[19:08:05] <lynxlynxlynx> newvalue is already unsigned
[19:09:16] <Adam007> void pcf_fatigue(Actor *actor, ieDword oldValue, ieDword newValue)
[19:09:30] <Adam007> w8
[19:09:32] <Adam007> i mean signed
[19:09:37] <Adam007> sry
[19:09:46] <Adam007> it is unsigned and needs to be converted to signed
[19:10:26] <lynxlynxlynx> BaseStats is also unsigned
[19:13:06] <Adam007> ok i think what problem is
[19:15:52] <lynxlynxlynx> the problem was with fetching the new mod when the value was negative
[19:15:58] <Adam007> in void Actor::Rest(int hours) we call SetBase (IE_FATIGUE, fatigueBonus); with negative fatigueBonus that is converted to unsigned (large uint) this is then handled to Actor::SetStat (again as large uint) which then calls pcf_fatigue (again large uint)
[19:16:05] <lynxlynxlynx> again since the default value in the table is -94, not 0
[19:16:17] <Adam007> yes
[19:16:35] <lynxlynxlynx> all this other signdness is not significant
[19:16:47] <Adam007> ok
[19:17:09] <-- Drakkar has left IRC (Ping timeout: 248 seconds)
[19:24:20] <lynxlynxlynx> ah, i think i found why we skip too much time
[19:28:57] <CIA-31> GemRB: 03lynxlupodian * r62d428f51801 10gemrb/gemrb/core/Scriptable/Actor.cpp: pcf_fatigue: try harder not to bomb luck and only whine when actually tired
[19:30:12] <-- kingron has left IRC (Remote host closed the connection)
[19:41:33] --> Drakkar has joined #gemrb
[19:48:11] <-- Drakkar has left IRC (Ping timeout: 252 seconds)
[20:05:33] --> Drakkar has joined #gemrb
[20:30:11] <-- kettuz has left IRC (Quit: Leaving)
[22:03:18] <-- Drakkar has left IRC (Ping timeout: 255 seconds)
[22:08:32] <Adam007> lynx what do you think
[22:08:33] <Adam007> diff --git a/gemrb/core/GameScript/GSUtils.cpp b/gemrb/core/GameScript/GSUtils.cpp
[22:08:33] <Adam007> index 41d6e54..1bfa561 100644
[22:08:33] <Adam007> --- a/gemrb/core/GameScript/GSUtils.cpp
[22:08:33] <Adam007> +++ b/gemrb/core/GameScript/GSUtils.cpp
[22:08:33] <Adam007> @@ -1687,6 +1687,18 @@ void MoveNearerTo(Scriptable *Sender, Scriptable *target, int distance)
[22:08:35] <Adam007> return;
[22:08:37] <Adam007> }
[22:08:39] <Adam007>
[22:08:41] <Adam007> + // Sender stops following invisible target
[22:08:43] <Adam007> + Actor *sender_obj = core->GetGame()->GetActorByGlobalID(Sender->GetGlobalID());
[22:08:45] <Adam007> + Actor *target_obj = core->GetGame()->GetActorByGlobalID(target->GetGlobalID());
[22:08:47] <Adam007> +
[22:08:49] <Adam007> + bool SenderSeeInvisible = (sender_obj->GetStat(IE_STATE_ID) & IE_SEEINVISIBLE);
[22:08:51] <Adam007> + bool TargetIsInvisible = (target_obj->GetStat(IE_STATE_ID) & STATE_INVISIBLE);
[22:08:53] <Adam007> +
[22:08:55] <Adam007> + if (!SenderSeeInvisible && TargetIsInvisible){
[22:08:59] <Adam007> + Sender->ReleaseCurrentAction();
[22:09:01] <Adam007> + return;
[22:09:03] <Adam007> + }
[22:09:05] <Adam007> +
[22:09:07] <Adam007> myarea = Sender->GetCurrentArea();
[22:09:09] <Adam007> hisarea = target->GetCurrentArea();
[22:09:11] <Adam007> if (hisarea && hisarea!=myarea) {
[22:09:13] <Adam007> stops from following invisible actors
[22:09:23] <lynxlynxlynx> first, use a pastebin next time
[22:09:38] <Adam007> ok
[22:10:03] <lynxlynxlynx> the invisibility check is too naive, you should probably use CanSee
[22:10:22] --> Drakkar has joined #gemrb
[22:11:02] <lynxlynxlynx> you already have both actors too, you just need to cast them (first check that both are of ST_ACTOR type)
[22:11:45] <lynxlynxlynx> IE_SEEINVISIBLE is a stat, not a state
[22:14:58] <Adam007> i think CanSee does not check invisibility in sense of magic spell
[22:15:48] <lynxlynxlynx> or maybe SeeCore
[22:17:49] <lynxlynxlynx> validtarget check for invisibilty
[22:18:37] <lynxlynxlynx> movetoobjectcore already does a similar check, though i didn't check if this is where you end up
[22:18:54] <lynxlynxlynx> but enough for tonight
[22:23:47] <-- lynxlynxlynx has left IRC (Remote host closed the connection)
[22:29:56] <-- Yoshimo has left IRC (Quit: Yoshimo)
[22:40:17] <-- Adam007 has left IRC (Quit: Leaving)