php Deck: createCards and location_arg
Posted: 05 January 2021, 21:50
Using the php deck component, when trying to initialise the location_arg with a large number, like the player_id, it corrupts the number, I was getting values between 50 and 70.
I initialise the type_arg with the same number as that is fine.
If afterwards I do this:
then the card_location_arg is now OK.
I initialise the type_arg with the same number as that is fine.
Code: Select all
$actionCards = [];
foreach( $players as $player_id => $player )
{
for( $value=100; $value<=103; $value++ )
{
$actionCards[] = array( 'type' => $value, 'type_arg' => $player_id, 'location_arg' => $player_id, 'nbr' => 1);
}
}
$this->cards->createCards( $actionCards, 'action_hand' );
Code: Select all
self::DbQuery( "UPDATE card SET card_location_arg=card_type_arg WHERE card_location='action_hand'");