fix surrender
This commit is contained in:
parent
dad2b5406c
commit
297d466b05
|
@ -101,7 +101,7 @@ Item {
|
|||
id: surrenderButton
|
||||
text: Backend.translate("Surrender")
|
||||
onClicked: {
|
||||
if (isStarted) {
|
||||
if (isStarted && !getPhoto(Self.id).dead) {
|
||||
const surrenderCheck = JSON.parse(Backend.callLuaFunction('CheckSurrenderAvailable', [miscStatus.playedTime]));
|
||||
if (!surrenderCheck.length) {
|
||||
surrenderDialog.informativeText = Backend.translate('Surrender is disabled in this mode');
|
||||
|
@ -149,7 +149,7 @@ Item {
|
|||
title: Backend.translate("Quit")
|
||||
informativeText: Backend.translate("Are you sure to quit?")
|
||||
buttons: MessageDialog.Ok | MessageDialog.Cancel
|
||||
onButtonClicked: function (button, role) {
|
||||
onButtonClicked: function (button) {
|
||||
switch (button) {
|
||||
case MessageDialog.Ok: {
|
||||
ClientInstance.notifyServer("QuitRoom", "[]");
|
||||
|
|
|
@ -1147,7 +1147,7 @@ local role_mode = fk.CreateGameMode{
|
|||
end
|
||||
|
||||
if p ~= Self and p.role == "rebel" then
|
||||
if p:isAlive() then
|
||||
if not p.dead then
|
||||
break
|
||||
else
|
||||
rebelNum = rebelNum - 1
|
||||
|
@ -1177,7 +1177,7 @@ local role_mode = fk.CreateGameMode{
|
|||
end
|
||||
|
||||
if p ~= Self and (p.role == "lord" or p.role == "loyalist") then
|
||||
if p:isAlive() then
|
||||
if not p.dead then
|
||||
break
|
||||
else
|
||||
lordNum = lordNum - 1
|
||||
|
|
Loading…
Reference in New Issue