| 388 | } |
| 389 | |
| 390 | bool lgoal::GetStatus(int handle, char operation, int *value, bool f_save_load, bool announce) { |
| 391 | if (!value) |
| 392 | return false; |
| 393 | |
| 394 | switch (operation) { |
| 395 | case LO_SET_SPECIFIED: |
| 396 | m_flags |= *value; |
| 397 | m_modified = 1; |
| 398 | |
| 399 | if (((*value) & LGF_COMPLETED) && !m_goal_completed) { |
| 400 | if (!f_save_load) |
| 401 | GoalComplete(handle, announce); |
| 402 | m_goal_completed = true; |
| 403 | } |
| 404 | |
| 405 | if (Game_mode & GM_MULTI && Netgame.local_role != LR_CLIENT) { |
| 406 | // send it off to the clients |
| 407 | SendMultiUpdate(handle); |
| 408 | } |
| 409 | return true; |
| 410 | break; |
| 411 | case LO_GET_SPECIFIED: |
| 412 | *value = m_flags; |
| 413 | return true; |
| 414 | break; |
| 415 | case LO_CLEAR_SPECIFIED: |
| 416 | // multisafe will pass in 0xFFFFFFFF on a clear before actually setting flags, |
| 417 | // so we need to ignore that case |
| 418 | if ((*value) != 0xFFFFFFFF && m_goal_completed) { |
| 419 | // check to see if we are marking this goal as "Not completed" |
| 420 | if ((*value) & LGF_COMPLETED) { |
| 421 | // unmark this m_goal_completed variable |
| 422 | m_goal_completed = false; |
| 423 | } |
| 424 | } |
| 425 | |
| 426 | m_flags &= ~(*value); |
| 427 | m_modified = 1; |
| 428 | |
| 429 | if (Game_mode & GM_MULTI && Netgame.local_role != LR_CLIENT) { |
| 430 | // send it off to the clients |
| 431 | SendMultiUpdate(handle); |
| 432 | } |
| 433 | return true; |
| 434 | break; |
| 435 | } |
| 436 | |
| 437 | return false; |
| 438 | } |
| 439 | |
| 440 | bool lgoal::SetDesc(char *desc) { |
| 441 | if (!desc) |
no outgoing calls
no test coverage detected