function marriage_modifyflirtpoints($who = 1, $amount = 0, $from = -1, $punish = true)
{
    //punish checks if flirting is with beloved one
    global $session;
    //now update the sent
    if ($from == -1) {
        $from = $session['user']['acctid'];
    }
    $list = get_module_pref('flirtssent', 'marriage', $from);
    $list = unserialize($list);
    if ($list == "") {
        $list = array();
    }
    if (array_key_exists("S" . $who, $list)) {
        $list["S" . $who] += $amount;
        //even when negative
    } else {
        $list = array_merge(array("S" . $who => $amount), $list);
    }
    //if ($list["S".$who]<1) $list=array_splice($list,"S".$who,1); //clean up, not working
    set_module_pref('flirtssent', serialize($list), 'marriage', $from);
    //now for the received ones
    $list = get_module_pref('flirtsreceived', 'marriage', $who);
    $list = unserialize($list);
    if ($list == "") {
        $list = array();
    }
    if (array_key_exists("S" . $from, $list)) {
        $list["S" . $from] += $amount;
        //even when negative
    } else {
        $list = array_merge(array("S" . $from => $amount), $list);
    }
    set_module_pref('flirtsreceived', serialize($list), 'marriage', $who);
    //if someone flirted not with the person married to
    if ($session['user']['marriedto'] != 0 && $session['user']['marriedto'] != 4294967295.0 && $who != $session['user']['marriedto'] && $from == $session['user']['acctid'] && $punish && $amount > 0) {
        $mailmessage = array("%s`0`@ has been unfaithful to you!", $session['user']['name']);
        $t = array("`%Uh oh!!");
        require_once "lib/systemmail.php";
        systemmail($session['user']['marriedto'], $t, $mailmessage);
        set_module_pref('flirtsfaith', get_module_pref('flirtsfaith') + 1);
        output("`n`@`c`bShame on you! Don't be unfaithful!`b`c");
        marriage_flirtdec();
    }
}
 if ($random <= $failchance && $flirtitem != 'ignore' && $flirtitem != 'slap') {
     $flirtitem = "fail";
 }
 switch ($flirtitem) {
     case "one":
         //auto-fail if flirtpoints are too far away
         output("`^%s`% realizes your intentions and looks disgustedly at you. Maybe you should get more charming to impress `^%s`%.", $name, $name);
         break;
     case "two":
         //auto-fail if flirtpoints are too far away
         output("`%You take a good look at `^%s`%. You don't think that the charm of `^%s`% is attracting you and therefore walk away.", $name, $name);
         break;
     case "fail":
         marriage_modifyflirtpoints($target, -$items["points-" . $flirtitem]);
         output("`^%s`% realizes your intentions and looks disgustedly at you. Your Flirt Points decrease with `^%s`% by `^%s`%.", $name, $name, $items["points-" . $flirtitem]);
         marriage_flirtdec();
         break;
     case "unblock":
         $ublo = get_module_pref('blocked');
         $my = explode(',', $ublo);
         $str = "";
         foreach ($my as $val) {
             if ($val == $target) {
             } else {
                 $str .= $val . ",";
                 if ($val > 0) {
                     $count++;
                 }
             }
         }
         set_module_pref('blocked', $str);