1. Список говнокодов пользователя noshitleft

    Всего: 2

  2. C# / Говнокод #17186

    +134

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    public void OnKillEvent_ServerOnly(PhotonPlayer player)
        {
        case MatchTypeInfo.TDM:
    
                    if (player != null)
                    {
                        var hash = player.customProperties;
    
                        if (hash != null)
                        {
                            var team = (int) hash["team"];
    
                            var realScore = match.GetTeamScores();
    
                            var teamAScor = team == 0 ? realScore.x + TeamDeathScores : realScore.x;
                            var teamBScor = team == 1 ? realScore.y + TeamDeathScores : realScore.y;
    
                            //DebugModule("Kill Processed On Server completed: " + team + "// " + teamAScor + "/" + teamBScor);
    
                            match.ChangeTeamScores((int)teamAScor, (int)teamBScor);
                        }
                        else
                        {
                            Debug.LogError("OnKillEvent_ServerOnly ERROR Team hash");
                        }
                    }
    
                    break;
    }  {
    //через 500 строк кода
       private void LocalUpdate()
        { 
        if (Application.isEditor)
            {
                if (Input.GetKeyDown(KeyCode.Y))
                {
                    switch (MatchType)
                    {
    
                        case MatchTypeInfo.TDM:
                            ChangeTeamScores((int)(_teamScores.x - 1), (int)(_teamScores.y - 1), true);
                            break;   }
    
                    SendTeamScoresToUI();
                }
            }
    
       switch (MatchType)
            {
                case MatchTypeInfo.TDM:
                   // DebugModule("Load TDM type game");
                    break;
    }
    }
    //ещё 500 строк
     public void ChangeTeamScores(int a, int b, bool force = false)
        {
    
            if (PhotonNetwork.isMasterClient)
            {
                // check server rules
                var rules = GetGameRules();
                if (rules != null)
                {
                    if (!rules.CheckPlayerCountRules() && !force)
                    {
                        Debug.LogError("Game is not started, beacuse server has no players: " + rules.MinimumPlayerToPlay + "/" +
                                       PhotonNetwork.room.playerCount);
                        return;
                    }
                }
                else
                {
                    Debug.LogError("Rule error");
                    return;
                }
    
                _teamScores.x = Mathf.Clamp(a, 0, float.MaxValue);
                _teamScores.y = Mathf.Clamp(b, 0, float.MaxValue);
    
                var matchIsCompleted = false;
    
                switch (MatchType)
                {
                    case MatchTypeInfo.TDM:
                        matchIsCompleted = _teamScores.x <= 0 || _teamScores.y <= 0;
                        break;
                }
                   if (matchIsCompleted)
                {
                    Server_CallEndRound();
                }
                else
                {
                    // Call Event??
                  }
    }
    }

    Чтобы я ещё раз полез помогать инди-разработчикам, мать их за ногу.

    noshitleft, 26 Ноября 2014

    Комментарии (3)
  3. C# / Говнокод #16715

    +135

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    if ((Mathf.Abs(_mouseOverX) > 0.2f || Mathf.Abs(_mouseOverY) > 0.2f))
         {
    
    
            switch (selecetedItemIndex)
         {
                case -1 :
                    var a = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
                    a += angle / 2.0f;
                    if (a < 0) a = a + 360.0f;
    
                    index = (int)(a / angle);
             break;
                case 0:
                    var a0 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
                    a0 += angle / 2.0f;
                    if (a0 < 0) a0 = a0 + 360.0f;
    
                    index = (int)(a0 / angle);
    
                 switch (index)
                 {
                     case 5 :
                         index = 7;
                         break;
                        case 6:
                            index = 7;
                            break;
                        case 4 :
                         index = -1;
                         break;
                        case 3:
                            index = 1;
                            break;
                        case 2:
                            index = 1;
                            break;
                 }
                 break;
                case 1:
                    var a1 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
                    a1 += angle / 2.0f;
                    if (a1 < 0) a1 = a1 + 360.0f;
    
                    index = (int)(a1 / angle);
    
                 switch (index)
                 {
                     case 0 :
                         index = 0;
                         break;
                        case 7:
                            index = 0;
                            break;
                        case 6 :
                         index = -1;
                         break;
                        case 5:
                            index = -1;
                            break;
                        case 4:
                            index = 3;
                            break;
                        case 3:
                            index = 3;
                            break;
                        case 2:
                            index = 2;
                            break;
                 }
                 break;
                case 2:
                    var a2 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
                    a2 += angle / 2.0f;
                    if (a2 < 0) a2 = a2 + 360.0f;
    
                    index = (int)(a2 / angle);
    
                    switch (index)
                    {
                        case 0: index = 1; break;
                        case 7: index = 1; break;
                        case 6: index = -1; break;
                        case 5: index = 3; break;
                        case 4: index = 3; break;
                    }
                    break;
                case 3:
                    var a3 = Mathf.Atan2(_mouseOverX, _mouseOverY) * Mathf.Rad2Deg;
                    a3 += angle / 2.0f;
                    if (a3 < 0) a3 = a3 + 360.0f;
    
                    index = (int)(a3 / angle);
    
                    switch (index)

    Radial menu govnokod style

    noshitleft, 17 Сентября 2014

    Комментарии (2)