Page 1 of 1

[Pol 097 2006 10 29 RC Coregina] repsys bug

Posted: Wed Nov 08, 2006 4:30 am
by VeNdOr
In OnAttack hook ( i dont' know if it happens even in the other hooks), if i use attacker.setcriminal(1), after running that istruction, the hook function terminates itself without running the rest of code. Moreover it happens something as the hook returned 0, and the pol uses his reputation system code for hook.
I make an example:

Code: Select all

exported function OnAttack(attacker, defender)
	if ( attacker.serial == defender.serial )
		// Safe to attack.. yourself?
		return 1;
	elseif ( defender.master )
		// Check for the npc's master.
		return OnAttack(attacker, defender.master);
	elseif ( IsInnocentTo(defender, attacker) )
		// Reset the criminal timer for the attacker.
PrintTextAbovePrivate( defender, "*"" is attacking you!*" , defender);
if attacker.SetCriminal is called the printtextabove is red as pol default repsys...

Posted: Wed Nov 08, 2006 9:18 pm
by Austin
Tested and confirmed. I'll look into it soon.

Posted: Thu Jan 18, 2007 8:27 am
by VeNdOr
Austin wrote:Tested and confirmed. I'll look into it soon.
what about this bug?

i haven't seen it fixed in the last release.

Posted: Thu Jan 18, 2007 9:21 am
by Austin
Its a very big project to fix it right now.. and I just haven't had the motivation to do-so.

There are pain-in-the-ass work-arounds anyway by storing criminal and murderer timers in cprops rather than relying on overlapping (there-in is the problem) core threads.

Posted: Fri Jan 19, 2007 11:00 am
by VeNdOr
Austin wrote:Its a very big project to fix it right now.. and I just haven't had the motivation to do-so.
drink a Red Bull, Red Bull Gives You Wings :D

Posted: Thu May 10, 2007 7:11 pm
by mr bubbles
Is it currently safe (bug free) to use the highlight/namecolour repsys hooks?

Posted: Thu May 24, 2007 12:06 am
by mr bubbles
Is it?

Posted: Fri Jun 01, 2007 4:19 pm
by mr bubbles
Three in a row :P Anyone know the answer?

Posted: Mon Jun 04, 2007 5:04 am
by Austin
Well it is safe as in it won't cause a crash, it never did.
What is not safe is that if you use the SetCriminal(x>0) or SetMurderer(x>0) methods in the hook, it causes it to stop at that point and the core finishes it.

You have to work around that limitation.

Posted: Mon Jun 04, 2007 2:31 pm
by mr bubbles
Ah thanks a lot for that Austin, cleared it up :smile:

Posted: Mon May 19, 2008 11:10 am
by ncrsn
Sorry if this is totally wrong thread, just didn't see this post worth of its own just yet...

Have you thought of moving the whole reputation system out from the core? I mean, doing system that does not rely on syshooks (and definitely not on packethooks). Lots of work I bet, but it might solve the (coming) issues once and for all AND make it more versatile for shard spesific customizations.

You don't have to be a core developer to be able to modify (, debug and fix!) a scripted system. I'd like to know if there is something critical relying on the reputation system that makes the whole idea impossible? Or just too hard to do.