Skip to content

Commit

Permalink
Merge pull request #20 from inFullMobile/develop
Browse files Browse the repository at this point in the history
Update 1.0.1
  • Loading branch information
noxytrux authored Jul 11, 2018
2 parents 9523e57 + 5eed3cc commit fd3c19b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CORE/AI/AIPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ AIObject *AIPlayer::addAIObject(AIAware *object) {

void AIPlayer::moveCurrentObjectToPoint(GameUnit *currentObject, xVec2 &destination) {

//no need to move at all
if (currentObject->_size == 0) {
return;
}

//"lock" thread
action = false;

Expand Down
5 changes: 0 additions & 5 deletions CORE/GameLogic/GameUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,6 @@ bool GameUnit::isActive() {
}

void GameUnit::makeMove() {

if (_size == 0) {
std::cout << "[Warning] No need to move unit does not exist" << std::endl;
return;
}

if ((_mode != UNIT_NOTMOVE) && !_move) {

Expand Down
18 changes: 7 additions & 11 deletions PLATFORM/Android/app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeSta

std::string mapName = jstringTostring(jenv, map);
gameLogic->createNewGame(mapName, playerSelected, playersPlaying, client);

if (client == nullptr) {
return;
}

client->setLoaded();
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFGameLib_nativeLoadGame(JNIEnv* jenv, jobject obj, jstring path) {
Expand Down Expand Up @@ -588,7 +594,7 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFMultiplayerFragme
case PFSocketCommandTypeDisconnect: {

client->disconnect();
callNativeVoidMethod(multiplayerClass, onDisconnectBridge);
callNativeVoidMethod(menuClass, onDisconnectBridge);
}
break;

Expand Down Expand Up @@ -841,13 +847,3 @@ JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragmen

return static_cast<jboolean >(client != nullptr);
}

JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_sendLoaded(JNIEnv* jenv, jobject obj) {

if (client == nullptr) {

return;
}

client->setLoaded();
}
2 changes: 0 additions & 2 deletions PLATFORM/Android/app/src/main/cpp/native-lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFJoinRoomFragment_
JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFJoinRoomFragment_joinRoom(JNIEnv* jenv, jobject obj, jint roomID);

JNIEXPORT jboolean JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_isMultiplayerMode(JNIEnv* jenv, jobject obj);
JNIEXPORT void JNICALL Java_com_noclip_marcinmalysz_pixfight_PFRenderFragment_sendLoaded(JNIEnv* jenv, jobject obj);


};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void onResume() {
if (isMultiplayer) {

updateMultiplayerState(false);
sendLoaded();

}
else {

Expand Down Expand Up @@ -206,10 +206,7 @@ public void multiplayeEndGame(int winnerID) {
builder.setTitle("Game finished, player " + Integer.toString(winnerID) + " win!");
builder.setCancelable(true);

builder.setItems(items, (dialogInterface, i) -> {

quitGame();
});
builder.setItems(items, (dialogInterface, i) -> {});

builder.create();
builder.show();
Expand Down Expand Up @@ -624,5 +621,4 @@ public static void onMutliplayerEndGameBridge(int playerID) {
public static native boolean saveGame(@NonNull String savepath);
@NonNull public static native String getMapName();
public static native boolean isMultiplayerMode();
public static native void sendLoaded();
}
2 changes: 1 addition & 1 deletion PLATFORM/Linux/MakeRoomScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void MakeRoomScene::Init() {
}

_info.insert(make_pair(0, make_pair(2, "tutorial")));
_info.insert(make_pair(1, make_pair(3, "hunt")));
_info.insert(make_pair(1, make_pair(3, "Hunt")));
_info.insert(make_pair(2, make_pair(2, "pasage")));
_info.insert(make_pair(3, make_pair(2, "waterway")));
_info.insert(make_pair(4, make_pair(4, "kingofhill")));
Expand Down
3 changes: 1 addition & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ If unit stays on base it gets extra defence bonus. Each turn you earn (N+1 * 100
* Move: 4

![Artillery](../master/CORE/Resources/textures/icons/icon_artillery1.png) - Artillery unit, cost 200.
* Strong against any unit.
* Powerful but vulnerable.
* May shoot at distance.
* If you move it first it cannot shoot.
* Weak agains Tank and Bazooka unit.
* Attack: 10
* Defence: 3
* Move: 3
Expand Down

0 comments on commit fd3c19b

Please sign in to comment.