fix: 사전거병 후 군주가 사라지는 경우에 대한 수정 #247
@@ -90,6 +90,9 @@ class BuildNationCandidate extends \sammo\BaseAPI
|
||||
return '거병을 실패했습니다.';
|
||||
}
|
||||
|
||||
$general->setVar('killturn', $env['killturn']);
|
||||
|
jyp9 marked this conversation as resolved
Outdated
|
||||
$general->applyDB($db);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3439,8 +3439,12 @@ class GeneralAI
|
||||
|
||||
$cmd = buildGeneralCommandClass($this->rng->choice($candidate), $this->general, $this->env);
|
||||
if (!$cmd->hasFullConditionMet()) {
|
||||
|
jyp9 marked this conversation as resolved
Outdated
Hide_D
commented
이번 코드 한정으로 제 스타일은 에 가깝긴 하겠네요. 물론 조기 탈출은 좋아합니다:) 이번 코드 한정으로 제 스타일은
```
if (!$cmd->hasFullConditionMet()) {
$cmd = buildGeneralCommandClass(딴거);
}
if (!$cmd->hasFullConditionMet()) {
$cmd = buildGeneralCommandClass(또딴거);
}
```
에 가깝긴 하겠네요.
물론 조기 탈출은 좋아합니다:)
jyp9
commented
아 이거 맨 처음 $cmd가 잘 되어 있으면 hasFullConditionMet()을 두 번이나 검사하게 되긴 하지만.. 그래도 스타일 맞추는 게 좋은게 좋은거지 싶어서 일단 따라가봄미다.. 아 이거 맨 처음 $cmd가 잘 되어 있으면 hasFullConditionMet()을 두 번이나 검사하게 되긴 하지만.. 그래도 스타일 맞추는 게 좋은게 좋은거지 싶어서 일단 따라가봄미다..
jyp9
commented
는 아무래도 아닌 거 같아서 약간 더 수정했습니다. 는 아무래도 아닌 거 같아서 약간 더 수정했습니다.
|
||||
return buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
|
||||
$cmd = buildGeneralCommandClass('che_물자조달', $this->general, $this->env);
|
||||
if (!$cmd->hasFullConditionMet()) {
|
||||
$cmd = buildGeneralCommandClass('che_견문', $this->general, $this->env);
|
||||
}
|
||||
}
|
||||
|
||||
return $cmd;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user
이 위치가 맞을까요? 거병에 성공한 시점이 이 시점인거 같아서 여기에 넣었습니다만..
API를 호출하는건 항상 유저이므로, NPCType 자체는 검사할 필요가 없는것 같고,
$general->setVar()를 했기 때문에,$general->applyDB($db)는 호출해줘야 할 것 같습니다.