Plugin Directory

Changeset 2180664


Ignore:
Timestamp:
10/26/2019 02:53:16 PM (6 years ago)
Author:
magent
Message:

Fixed issue where pending XP on non-visible skills wasn't showing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vampire-character/trunk/inc/xpfunctions.php

    r2056056 r2180664  
    3131   
    3232   
    33     /*
    34     $submitted = array();
    35     if (isset($_REQUEST['stat_level'])) {
    36         $submitted[] = "Statistics";
    37         $newid = vtm_save_to_pending('stat', 'CHARACTER_STAT', 'STAT', 'STAT_ID', $playerID, $characterID);
    38     }
    39     if (isset($_REQUEST['skill_level'])) {
    40         $submitted[] = "Abilities";
    41         $newid = vtm_save_to_pending('skill', 'CHARACTER_SKILL', 'SKILL', 'SKILL_ID', $playerID, $characterID);
    42     }
    43     if (isset($_REQUEST['disc_level'])) {
    44         $submitted[] = "Disciplines";
    45         $newid = vtm_save_to_pending('disc', 'CHARACTER_DISCIPLINE', 'DISCIPLINE', 'DISCIPLINE_ID', $playerID, $characterID);
    46     }
    47     if (isset($_REQUEST['path_level'])) {
    48         $submitted[] = "Paths";
    49         $newid = vtm_save_to_pending('path', 'CHARACTER_PATH', 'PATH', 'PATH_ID', $playerID, $characterID);
    50     }
    51     if (isset($_REQUEST['ritual_level'])) {
    52         $submitted[] = "Rituals";
    53         $newid = vtm_save_to_pending('ritual', 'CHARACTER_RITUAL', 'RITUAL', 'RITUAL_ID', $playerID, $characterID);
    54     }
    55     if (isset($_REQUEST['merit_level'])) {
    56         $submitted[] = "Merits";
    57         $newid = vtm_save_to_pending('merit', 'CHARACTER_MERIT', 'MERIT', 'MERIT_ID', $playerID, $characterID);
    58     }
    59     if (isset($_REQUEST['combo_level'])) {
    60         $submitted[] = "Combination Disciplines";
    61         $newid = vtm_save_to_pending('combo', 'CHARACTER_COMBO_DISCIPLINE', 'COMBO_DISCIPLINE', 'COMBO_DISCIPLINE_ID', $playerID, $characterID);
    62     }
    63     */
    6433   
    6534    if ($count > 0) {
     
    7039    }
    7140}
    72     /*
    73 //  master_xp_update VTM_FORM
    74 function vtm_handleMasterXP() {
    75     $counter = 1;
    76     while (isset($_POST['counter_' . $counter])) {
    77         $current_player_id = $_POST['counter_' . $counter];
    78         $current_xp_value  = $_POST[$current_player_id . '_xp_value'];
    79         if (is_numeric($current_xp_value) && ((int) $current_xp_value != 0)) {
    80             vtm_addPlayerXP($current_player_id,
    81                 $_POST[$current_player_id . '_character'],
    82                 $_POST[$current_player_id . '_xp_reason'],
    83                 $current_xp_value,
    84                 $_POST[$current_player_id . '_xp_comment']);
    85         }
    86         $counter++;
    87     }
    88 }
    89    
    90 // Add XP to the database
    91     // - called by handleMasterXP
    92     // - and handleGVLarpForm
    93 
    94 // shortcode
    95 */
     41
    9642
    9743function vtm_print_xp_spend_table() {
     
    11965    }
    12066   
    121     /*  if (isset($_REQUEST['stat_cancel']))    vtm_cancel_pending($_REQUEST['stat_cancel']);
    122     if (isset($_REQUEST['skill_cancel']))   vtm_cancel_pending($_REQUEST['skill_cancel']);
    123     if (isset($_REQUEST['disc_cancel']))    vtm_cancel_pending($_REQUEST['disc_cancel']);
    124     if (isset($_REQUEST['combo_cancel']))   vtm_cancel_pending($_REQUEST['combo_cancel']);
    125     if (isset($_REQUEST['path_cancel']))    vtm_cancel_pending($_REQUEST['path_cancel']);
    126     if (isset($_REQUEST['ritual_cancel']))  vtm_cancel_pending($_REQUEST['ritual_cancel']);
    127     if (isset($_REQUEST['merit_cancel']))   vtm_cancel_pending($_REQUEST['merit_cancel']);
    128     */
     67
    12968    // Back button
    13069    if (isset($_REQUEST['xCancel']) || $docancel) $step = "";
     
    179118        }
    180119    }
    181     /*
    182     if (isset($_REQUEST['stat_level']))   $spent += vtm_calc_submitted_spend('stat');
    183     if (isset($_REQUEST['skill_level']))  $spent += vtm_calc_submitted_spend('skill');
    184     if (isset($_REQUEST['disc_level']))   $spent += vtm_calc_submitted_spend('disc');
    185     if (isset($_REQUEST['combo_level']))  $spent += vtm_calc_submitted_spend('combo');
    186     if (isset($_REQUEST['path_level']))   $spent += vtm_calc_submitted_spend('path');
    187     if (isset($_REQUEST['ritual_level'])) $spent += vtm_calc_submitted_spend('ritual');
    188     if (isset($_REQUEST['merit_level']))  $spent += vtm_calc_submitted_spend('merit');
    189     */
     120
    190121    $output .= "<p>Spending $spent experience points.</p>\n";
    191122    $output .= "<p>Please enter specialisations, if available, and enter a description of your learning method</p>";
     
    194125   
    195126    $output .= vtm_render_details_section($characterID);
    196 /*     
    197    
    198     if (isset($_REQUEST['stat_level'])) {
    199         $output .= vtm_render_details_section('stat');
    200     }
    201     if (isset($_REQUEST['skill_level'])) {
    202         $output .= vtm_render_details_section('skill');
    203     }
    204     if (isset($_REQUEST['disc_level'])) {
    205         $output .= vtm_render_details_section('disc');
    206     }
    207     if (isset($_REQUEST['combo_level'])) {
    208         $output .= vtm_render_details_section('combo');
    209     }
    210     if (isset($_REQUEST['path_level'])) {
    211         $output .= vtm_render_details_section('path');
    212     }
    213     if (isset($_REQUEST['ritual_level'])) {
    214         $output .= vtm_render_details_section('ritual');
    215     }
    216     if (isset($_REQUEST['merit_level'])) {
    217         $output .= vtm_render_details_section('merit');
    218     }
    219     */
     127
    220128    $output .= "<input class='vtmxp_submit' type='submit' name='xSubmit' value='Spend XP'>\n";
    221129    $output .= "<input class='vtmxp_submit' type='submit' name='xCancel' value='Back'>\n";
     
    726634                    cha_item.SKILL_ID = item.ID
    727635                LEFT JOIN
    728                     (SELECT ID, CHARTABLE_ID, CHARTABLE_LEVEL
     636                    (SELECT ID, ITEMTABLE_ID, CHARTABLE_LEVEL
    729637                    FROM
    730638                        " . VTM_TABLE_PREFIX . "PENDING_XP_SPEND
    731639                    WHERE
    732640                        CHARACTER_ID = %s
    733                         AND CHARTABLE = 'CHARACTER_SKILL'
     641                        AND ITEMTABLE = 'SKILL'
    734642                    ) as pending
    735643                ON
    736                     pending.CHARTABLE_ID = cha_item.ID,
     644                    pending.ITEMTABLE_ID = item.ID,
    737645                " . VTM_TABLE_PREFIX . "SKILL_TYPE skilltype,
    738646                " . VTM_TABLE_PREFIX . "COST_MODEL_STEP steps,
     
    748656                        (ISNULL(cha_item.level) AND steps.CURRENT_VALUE = 0)
    749657                    )
    750                 AND item.MULTIPLE = 'N'";
     658                AND item.MULTIPLE = 'N'
     659                AND (item.VISIBLE = 'Y' OR pending.CHARTABLE_LEVEL > 0)
     660                ";
    751661   
    752662    $sql_mult_new = "SELECT
Note: See TracChangeset for help on using the changeset viewer.