dataviruset / sm-hosties

The ultimate jailbreak plugin for SourceMod
https://forums.alliedmods.net/forumdisplay.php?f=155
GNU General Public License v3.0
29 stars 27 forks source link

Timer_Beacon #85

Closed WhyFaust closed 7 years ago

Bara commented 7 years ago

And that should work?

WhyFaust commented 7 years ago

It works for me, well, about Help Beams I do not know what to do.

WhyFaust commented 7 years ago

Yes, everything works at the moment)

data-bomb commented 7 years ago

@mrkos9i4ok , you have already done a great job and identified the problem with the Beacons. It is that the modulus lines are not working any longer. The only change we have made to that is 'new' to 'int', so if it is no longer working then this could be a larger issue with the SourceMod compiler. Rather than re-invent the wheel, why not print out the values of modTime and iTimerCount and the modulus operation result? If there is a compiler issue then this needs to be addressed.

data-bomb commented 7 years ago

int result = iTimerCount % modTime; PrintToConsole(LR_Player_Guard, "iTimerCount %d, modTime %d, result %d", iTimerCount, modTime, result); @mrkos9i4ok Are you available to help investigate the root cause?

WhyFaust commented 7 years ago

Yes,okey

WhyFaust commented 7 years ago

iTimerCount 2, modTime 10, result 2 Always

int iTimerCount = 1; iTimerCount++; result iTiMerCount =2

Next step int iTimerCount = 1; iTimerCount++; result iTiMerCount =2

data-bomb commented 7 years ago

@mrkos9i4ok Thanks! @Bara20 Looks like when we ported syntax we changed a static int declaration to just an int declaration. This would definitely cause it to be 2 every time the timer triggers. The fix should just be to change the initiation from int iTimerCount = 1; back to static iTimerCount = 1;

Or is static variables no longer supported? If this is the case, we should just switch to a global variable.

data-bomb commented 7 years ago

https://github.com/dataviruset/sm-hosties/commit/e083d33074f28d5efbe3677871a0fa23415219c5 seeks to address this. This has caused the conflict for this section of the code.

WhyFaust commented 7 years ago

Yes,All nice worked

data-bomb commented 7 years ago

Great! I will close this PR and my commit plus Bara's PR #86 will resolve this.