Update GamblingPlugin.php with Stitch's fixes.
This commit is contained in:
parent
4d8e6d95fe
commit
c8e573a72d
|
@ -6,7 +6,7 @@ if (!defined('GNUSOCIAL')) {
|
|||
|
||||
class GamblingPlugin extends Plugin
|
||||
{
|
||||
const VERSION = '0.0.1';
|
||||
const VERSION = '0.0.2';
|
||||
|
||||
const ROLL_RE = '/\/roll\+(?<rolls>\d+)d(?<faces>\d+)/';
|
||||
|
||||
|
@ -54,11 +54,11 @@ class GamblingPlugin extends Plugin
|
|||
$rolls = intval($matches[1]);
|
||||
$faces = intval($matches[2]);
|
||||
|
||||
$bad_rolls = $rolls < 1 or $rolls > $obj->settings('max_rolls');
|
||||
$bad_faces = $faces < 2 or $faces > $obj->settings('max_faces');
|
||||
$bad_rolls = $rolls < 1 || $rolls > $self::settings('max_rolls');
|
||||
$bad_faces = $faces < 2 || $faces > $self::settings('max_faces');
|
||||
|
||||
if ( $bad_rolls or $bad_faces ) {
|
||||
$obj->roll_str = "Rolled: bad roll";
|
||||
if ( $bad_rolls || $bad_faces ) {
|
||||
$obj->roll_str = "Bad roll, The correct syntax is: '/roll+XdY' where X is max of " . self::settings('max_rolls'). "& Y is max of " . self::settings('max_faces') . ".";
|
||||
}
|
||||
else {
|
||||
$total = 0;
|
||||
|
|
Loading…
Reference in New Issue