projects
/
e-DoKo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BUGFIX: forgot to set default values for some new variables
[e-DoKo.git]
/
include
/
game.php
diff --git
a/include/game.php
b/include/game.php
index 668aa1fe06096a59d2e2512116fe0e135a74b3b0..a90d8b2dea1418bfdd3be82a2461a92a7b216dc0 100644
(file)
--- a/
include/game.php
+++ b/
include/game.php
@@
-26,6
+26,8
@@
if(!$myid)
exit();
}
exit();
}
+global $GAME,$RULES,$CARDS;
+
/* user might get here by clicking on the link in an email, so session might not be set */
if(isset($_SESSION["name"]))
output_status($_SESSION["name"]);
/* user might get here by clicking on the link in an email, so session might not be set */
if(isset($_SESSION["name"]))
output_status($_SESSION["name"]);
@@
-76,6
+78,11
@@
else
$ok=1;
}
$ok=1;
}
+/* these are the defaults */
+$GAME['schweinchen-who'] = NULL;
+$GAME['schweinchen-first'] = NULL;
+$GAME['schweinchen-second'] = NULL;
+
if($ok)
{
/* need to check for Schweinchen */
if($ok)
{
/* need to check for Schweinchen */
@@
-89,13
+96,10
@@
if($ok)
$GAME['schweinchen-first'] = 0; /* to keep track if they have been played already */
$GAME['schweinchen-second'] = 0;
}
$GAME['schweinchen-first'] = 0; /* to keep track if they have been played already */
$GAME['schweinchen-second'] = 0;
}
-else
-{
- /* no need to check for Schweinchen */
- $GAME['schweinchen-who']=NULL;
-}
/* end check for Schweinchen */
/* end check for Schweinchen */
+set_gametype($gametype); /* this sets the $CARDS variable */
+
/* put everyting in a form */
echo "<form action=\"index.php?action=game&me=$me\" method=\"post\">\n";
/* put everyting in a form */
echo "<form action=\"index.php?action=game&me=$me\" method=\"post\">\n";
@@
-211,7
+215,7
@@
switch($mystatus)
case 'init':
/* here we ask the player if he is sick */
$mycards = DB_get_hand($me);
case 'init':
/* here we ask the player if he is sick */
$mycards = DB_get_hand($me);
-
sort($mycards
);
+
$mycards = mysort($mycards,$gametype
);
/* output sickness of other playes, in case the already selected and are sitting in front of the current player */
echo "\n<ul class=\"tricks\">\n";
/* output sickness of other playes, in case the already selected and are sitting in front of the current player */
echo "\n<ul class=\"tricks\">\n";
@@
-333,7
+337,7
@@
switch($mystatus)
if($mystatus=='check')
{
$mycards = DB_get_hand($me);
if($mystatus=='check')
{
$mycards = DB_get_hand($me);
-
sort($mycards
);
+
$mycards = mysort($mycards,$gametype
);
/* output sickness of other playes, in case the already selected and are sitting in front of the current player */
echo "\n<ul class=\"tricks\">\n";
/* output sickness of other playes, in case the already selected and are sitting in front of the current player */
echo "\n<ul class=\"tricks\">\n";
@@
-1127,6
+1131,7
@@
switch($mystatus)
{
$card = $_REQUEST["card"];
$handid = DB_get_handid('hash',$me);
{
$card = $_REQUEST["card"];
$handid = DB_get_handid('hash',$me);
+ $commentSchweinchen =""; /* used to add a comment when Schweinchen is being played */
/* check if we have card and that we haven't played it yet*/
/* set played in hand_card to true where hand_id and card_id*/
/* check if we have card and that we haven't played it yet*/
/* set played in hand_card to true where hand_id and card_id*/
@@
-1722,7
+1727,10
@@
switch($mystatus)
foreach($mycards as $card)
{
foreach($mycards as $card)
{
- if($followsuit && !same_type($card,$firstcard))
+ if( ($followsuit && !same_type($card,$firstcard)) ||
+ ( (int)($card)==19 && ($RULES['schweinchen']=='second'||$RULES['schweinchen']=='secondaftercall')
+ && $GAME['schweinchen-who']==$me && !$GAME['schweinchen-first'] )
+ )
display_card($card,$PREF["cardset"]);
else
display_link_card($card,$PREF["cardset"]);
display_card($card,$PREF["cardset"]);
else
display_link_card($card,$PREF["cardset"]);